Today , I want to explain a really cool feature, in order to improve performance of your app and make it “code” more tidier.
NB: This is Experimental Feature, as an experimental feature, do not use named formulas in production apps.
We can use App.OnStart to inizializiate variables, load data and do some operations. These actions my be cause slow starting of your application. Sometimes we use , for example hidden button to write “reusable” code.
Now , we can write formulas and reuse it in any part of our application.
Enabled Named Formulas
Firs of all, you must enable experimental feature. Click on “Settings” and enable it:
Now, you should see new property of your app, called “Formulas”. Here you can add your formula!
Here you can add your formulas. For example:
ParamID = Param("ID"); UserEmail = User().Email;
But, of course, you can add more complex formula.
Why we should use named formulas? let’s see some advantages:
- The formula’s value is always available. There is no timing dependency, no event likes App.OnStart should be executed.
- Formulas can be calculated in parallel.
- The formula’s value is always up to date.
- The formula’s definition is immutable. As opposed to variables, the definition in App.Formulas is the only “source of truth” and the value can’t be changed somewhere else in the app.
- Calculated when needed. Value are calculated when app need it so this can improve app load time.
I hope these information can help you! Here link with additional informations.
Contact me for questions! Have a nice day!