Inline array processing at Hyperformula

Tags: #<Tag:0x00007efc61fe8d50> #<Tag:0x00007efc61fe8bc0>

Hello.
I read article (link) that I can use structure like {1,2,3} inside formulas. But it doesn’t work in my project with Hyperformula 0.6.2.

From which version I can use such structure? And how can I pass inline array into formula in Handsontable 9.0.0 and Hyperformula 0.6.2?

Hi @denial.trombol

HyperFormula v1.0.0 is the first stable version where this type of syntax works https://codesandbox.io/s/jovial-kate-kypzpd

You can either try to update your HyperFormula version in Handsontable v9 (but it does not guarantee that everything will work) or update Handsontable to v10.0.0, as we updated HyperFormula in that version from 0.6.2 to ^1.1.0 (ref: https://handsontable.com/docs/react-data-grid/release-notes/#_10-0-0).

I highly recommend the second approach as in v10.0.0 we also removed one important vulnerability. You can check that here, in the SNYK report.

If you decide to update to v10.x here’s a migration guide that can help https://handsontable.com/docs/react-data-grid/migration-from-9.0-to-10.0/. You can also reach us at support@handsontable.com if anything arises.

@aleksandra_budnik thank you for fast answer and for such hint. Will try to update version.

1 Like

@aleksandra_budnik
I tried to update my app for using Handsontable 10.0.0 and now I see formulas instead of values inside cells. Do you have any ideas why such issue occur?

Please check if you use the

formulas: {
  engine: HyperFormula
}

the formulas: true will no longer work in newer versions.

I’m using this code for engine property:

function getEngine() {
  const hf = HyperFormula.buildEmpty({
    licenseKey: 'internal-use-in-handsontable',
    precisionRounding: 6,
    maxColumns,
    maxRows,
  });
  hf.addNamedExpression('TRUE', '=TRUE()');
  hf.addNamedExpression('FALSE', '=FALSE()');
  return hf;
}

@aleksandra_budnik
I found the fix. Previously I pushed values to Handsontable and Hyperformula by next code:

this.hot.updateSettings({
  formulas: {
    sheetName: this.mainSheetName,
  },
  data: this.data,
});

But now it doesn’t pass data to Hyperformula. So I tried to use next:

this.hf.setSheetContent(this.mainSheetName, this.data);

And it pass data properly👍

I’m happy to hear about the progress. Thank you for sharing the update @denial.trombol

I think hat we can close this thread.

1 Like