API to validate the calculated value

Answered
Vignesh Punniamoorthy asked on November 11, 2024

I have a window application, where I allow user to configure the pivot table configuration and save it as a file.

I reads the config from the file using web application and renders the pivot table.

Here in the window application I implemented a widget to add the calculated values,

I need an API to validate the entered calculated value is correct or not.

Suggest solution for this.

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster November 12, 2024

Hello Vignesh,

Thank you for reaching out to us.

We want to explain that Flexmonster does not have a dedicated API specifically for validating calculated values. However, you are free to implement the logic of checking if the formula is valid on your side. The idea is to check the user input based on the following conditions:

  1. Check if the formula contains valid operations and the correct number of arguments. Here's a list of the available operators and functions: https://www.flexmonster.com/doc/calculated-values/#formula-operators
  2. Confirm that the field name is present in the dataset (e.g., use the getAllHierarchies API call) and if aggregation is supported by the field data type: https://www.flexmonster.com/doc/aggregation-functions/.
  3. Ensure that there are both left and right sides of the formula.
  4. Check the proper syntax. For example, catch issues like missing brackets or quotes.

The described approach should help you validate the calculated values the user enters.

Please let us know if it works for you. Looking forward to hearing from you.

Kind regards,
Nadia

Please login or Register to Submit Answer