Reload formulas after adding new row when filters are applied

Hello there!
I need a help getting source date when filters are applied. I know that handsontable/hyperformula handles re-assigning formulas when moving rows (e.g. when filters are applied) but it seems it only handles re-assignment of values of visible rows.

I have prepared an example:

  1. Console log source data:
[
    [
        "=B1+C1",
        3,
        5
    ],
    [
        "=B2+C2",
        1,
        2
    ],
    [
        "=B3+C3",
        2,
        5
    ],
    [
        "=B4+C4",
        6,
        3
    ]
]
  1. Filter A column by value (e.g. 3)
  2. Insert new row by using context menu
  3. Console log source data
[
    [
        "=B1+C1",
        3,
        5
    ],
    [
        "=B2+C2",
        1,
        2
    ],
    [
        "=B3+C3",
        "52",
        "26"
    ],
    [
        "=B3+C3",
        2,
        5
    ],
    [
        "=B4+C4",
        6,
        3
    ]
]

(=B3+C3 value is duplicated)
5. Remove filters
6. Console log source data

[
    [
        "=B1+C1",
        3,
        5
    ],
    [
        "=B2+C2",
        1,
        2
    ],
    [
        "=B3+C3",
        "52",
        "26"
    ],
    [
        "=B4+C4",
        2,
        5
    ],
    [
        "=B5+C5",
        6,
        3
    ]
]

(All formulas are correctly re-assigned)

Is there a way to force this “re-assignment” when filters are applied? I store spreadsheet’s state in DB and I’m sending the spreadsheet value after each change but filters are causing incorrect formulas to be saved.

Hi @alojzy231

I checked your example first and followed the steps you described but for me it always returns the correctly re-assigned formulas. I filtered the value 3 from the A column, then I inserted a new row in the same position as you, and that’s what I got:

1. 0: Array[3]

  1. 0: "=B1+C1"

  2. 1: 3

  3. 2: 5
2. 1: Array[3]

  1. 0: "=B2+C2"

  2. 1: 1

  3. 2: 2
3. 2: Array[3]

  1. 0: "=B3+C3"

  2. 1: 2

  3. 2: 5
4. 3: Array[3]

  1. 0: "=B4+C4"

  2. 1: "83"

  3. 2: "70"
5. 4: Array[3]

  1. 0: "=B5+C5"

  2. 1: 6

  3. 2: 3

Here’s instruction with screenshot how to replicate the example:

  1. Console log source data:

  2. Filter A column by value (e.g. 3)

  3. Insert new row by using context menu

  4. Console log source data


    (=B3+C3 value is duplicated)

  5. Remove filters

  6. Console log source data

(All formulas are correctly re-assigned)

Hi @alojzy231

Thank you, now I was able to get the same results. I will check for possible solution and update you shortly.