I want to let system administrators to define formula and store in the database.
How can is calculate formulas ,stored in database dynamically
(formula contains: field names ,functions ,operators and ...)
Could you help me please?
Hi S,
What kind of formulas you want admin to configure , are those formulas are dynamic ?Can admin define any formula and store it in database?
I did one similar implementation but the number of formula were fixed and every formula had one action defined for its calculation in Outsystems.
There were switch case based implementation, whatever formula user selected the corresponding action will get executed with all the required input parameter .
Could you please let me know some more information about your required implementation ?
Regards,
-PJ-
Thank you for your prompt reply.
I will tell you the imagination I have.
However, I am not good at English, so I will attach a table created in Excel.
Application is Create entity 2 from entity 1 using the formula for entity 3.
Entity 3 can be edited, added and deleted by the administrator.
The number of entities 2 will always be the same as the number of entities 3.
The last table is the format that is actually displayed on the screen.
You can follow below steps -
1. While saving the formulas in DB use the variables as the column names of Entity 1.
2. After retrieving the formulas replace the column names with the values fetched from Entity 1 at run time by using string_replace (may in you can do it in loop on Entity 2.)
3. Assign the values into structure and display on UI.
Let me know if this helps. Or you need any more details.
Thanks,
Unnati K.
Hi S.Kawaguchi,
I did same kind of formula calculations in one of my application. I dont know what is your exact requirement but you should store field names ,functions ,operators in database and using these you create the formula in screen using screen logic and do the calculation accordingly.
If it is not work for you please explain in detail or share your oml to analyze the problem.
Regards
Shashikant Shukla
Hi S. Kawaguchi,
You can use the Formula Forge component. It has a Try Now option where you can see a demo and download to learn how you can work with it.
Here is a glimpse on the demo where you can add variables on the right and have the formula on the left.
Hope it helps
Regards,João