Named Formulas will be available as an experimental feature in Power Apps this September.
The use of named formulas can be read in detail in Greg Lindhorst’s post:
https://powerapps.microsoft.com/en-us/blog/power-fx-introducing-named-formulas/
Shortly:
As soon as the feature has been activated in the Experimental Features, the Formulas property is available for the App element.
If you previously made global settings in App.OnStart, now do them in App.Formulas:
Here, too, the syntax was clearly declarative. Did you previously use the following syntax for the declaration:
Set(glbCurrentRecord,Last(DataSource))
Now use the following syntax in the form property:
glbCurrentRecord=Last(DataSource);
Don’t forget the trailing semicolon! (In German environments, please two of them!)
The same, just different?
If you needed the most recent record on a screen, you had to run the Set(glbCurrentRecord,Last(DataSource)) formula again to set the glbCurrentRecord variable.
This is different now, because the named formula is always updated automatically.
Performance boost or killer?
In today’s Friday community round, the question arose how often this update takes place, because that can cause an unnecessarily large number of Power Platform API calls that run against my limit. In addition, an unnecessarily large number of data transfers are carried out, which on the one hand impair my performance and on the other hand are bad for the climate.
Microsoft has given us a tool to check what is happening in the background: the monitor!
If you take a look at what is going on in the app, you will see that it is by no means the case that a formula is always up to date. If I change data on the database, in my case DataVerse, no update takes place.
But as soon as I update the database from the app. According to my current tests, this can only be done by Refresh (data source) and writing operations such as SubmitForm or Patch.
Pure use for display or within reading functions such as LookUp currently has no effect:
Since it is still an experimental feature at the moment, one can certainly assume that something will happen there. I will keep you up to date!
PapaRiedel
Du muss angemeldet sein, um einen Kommentar zu veröffentlichen.