Is there any way to get functions/variables used by a formula. #1077
Replies: 6 comments 3 replies
-
Hi @makarandp0, thanks for reaching out to us. You may take a look at method getCellPrecedents() which returns all cells contained in the formula, but with the current API, there is no way to get the functions and named expressions. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response @sequba. |
Beta Was this translation helpful? Give feedback.
-
Hi, @makarandp0 we discussed your request with the team. Would you mind giving us more context about it?
|
Beta Was this translation helpful? Give feedback.
-
Hi @sequba, I am in a similar situation. In my application I use HyperFormula to calculate values in quite big forms. I want to show my user the values of the inputs used in a formula. Would be a useful feature to be able to obtain referenced variables for a formula. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hello @sequba, Sorry for being super late responding on this. Our problem was how do we ensure that the formulas are valid when they are authored. That is they are not referencing some named expression or functions that are not available? For example, we allow only fixed number of named expressions say: ["color", "size", "height"], and we want to ensure that we do not allow authoring formula like We found a workaround for this, but now ran into another problem. We also allow some subset of formula function. For example we allow formula hope that gives some context. Please let me know if you need more information |
Beta Was this translation helpful? Give feedback.
-
Hey all! Here https://hyperformula.handsontable.com/api/classes/hyperformula.html#getnamedexpressionsfromformula we have a reference to the new method we've introduced in v2.7.0 called I hope you'll find it useful. |
Beta Was this translation helpful? Give feedback.
-
Description
I am looking for a way to get all functions/variables referenced in a formula - Is it possible with the current API?
basically given a formula like this
we want to know that
["foo", "bar"]
are the variables referenced, and the functions referenced are["SUM"]
Beta Was this translation helpful? Give feedback.
All reactions