I have a dynamic formula that needs calculation.
Here's a sample (var1 * var2) / (var3 * (23 * 100))
These variables will be replaced with actual numbers because they are user input. Currently, I am using power automate flow that connects to my web API to throw any calculation and solve it. then send back the result. I am using NCalc and/or DataTable on the API.
What I was hoping to do was to pass the calculation in any Control like label or text. If you put 1+1 to the Text property of a Label Control. It will show the number 2 right away but since I am passing string it doesn't work. I can use something like this Value("100" * "300") and this works as long as we stick with math operators only but fails when we have the open and close parentheses like this (21 * 100) / (0.43 * (23 * 100))
I will appreciate it if you have a workaround in mind. Thank you in advance.
I finally solve this issue by using a PCF Control and since it enables the use of JavaScript I can simply use the eval function and solve any equation you throw at it.
more info here: https://learn.microsoft.com/en-us/powerapps/developer/component-framework/create-custom-controls-using-pcf