Named formulas in Power Apps using App.Formulas
Do you use the App onstart to set a lot of variables? And then do you repeat this same within other places of the app to keep things up to date? The new named formulas in App.Formula might be a better option.
Enable Named Formulas
To enable Named functions you can go to the Settings in your app. Then switch on the Named formula feature. Notice that this feature is still experimental, but it is a great feature to try out ( in non production apps)
Configuring Named Formulas
Now you can configure within App.Formulas using lines of code like this:
X = CountRows(List)
It might look like there isn’t much of difference between the Set and the ‘=’ assignment. But there is!
Difference between Set and Named Formulas
With the Set function you will set a value to a variable. This means that every time you want the variable to be updated you will have to rerun the code.
With Named functions you don’t have to do this. As your data changes ( in my example the datasource List), the value given by the Named function will automatically change. So in the earlier example as the List is updated and refreshed, the value of X will automatically be updated too.
That is one thing less to worry about in your app.
Continue Reading Pieter Veenstra’s Article on their blog
Named formulas in Power Apps using App.Formulas
Do you use the App onstart to set a lot of variables? And then do you repeat this same within other places of the app to keep things up to date? The new named formulas in App.Formula might be a better option. To enable Named functions you can go to the Settings in your app.
Blog Syndicated with Pieter Veenstra’s Permission
More About This Author
Array
- Modern Workplace26 March 2024Receive the available storage within your SharePoint Online tenant
- Modern Workplace20 March 2024Options for Documenting Your Power Apps: Comments, Code, and Controls
- Modern Workplace18 March 20242 ways to duplicate SharePoint Lists to support your Power Apps
- Modern Workplace14 March 2024Update a Hyperlink Column in SharePoint with Power Automate