Power Apps Named Formulas became generally available (GA) in November 2023, offering a new feature to enhance app performance, scalability, and maintainability. Named formulas allow for the definition of values or objects for use throughout an app, similar to variables or collections.
Abusing the OnStart property of a canvas app can lead to long wait times for app loading. With named formulas, creators can avoid such issues, ensuring points of reference stay current in real-time without the need to reset variables or rebuild collections.
Accessing named formulas is simple; they are located in the same area as the OnStart property. When editing an app, you can find them under 'Formulas' in the property drop-down, making it convenient for developers to implement named formulas in their designs.
Naming conventions for named formulas can be tricky to standardize. The author suggests using prefixes like nf to indicate named formulas, aiding other developers in identifying and understanding their use within an app.
Named formulas in Power Apps are advantageous for various use cases that were traditionally handled by the OnStart property, such as capturing logged-on user info and counting records. Their self-updating nature removes the need to rerun code for current values, simplifying the app's behavior and reducing redundancies in code.
Building collections from data sources and manually, along with theming and getting environment variable values, can benefit from using named formulas. These not only improve the app's performance but also its structure by reducing logic in the OnStart property.
Creators must decide whether to use named formulas or traditional methods based on whether the reference data will change during a session. Despite their benefits, it is essential to remember that not all OnStart functionalities should be moved to named formulas; strategic planning based on user interaction remains crucial.
For more insights on Power Apps and the Power Platform, consider subscribing to the author's content updates.
Power Apps Named Formulas are bringing a notable shift in how developers manage and utilize data across their applications. By allowing the creation of reusable definitions that remain up-to-date in real time, these formulas are helping to streamline app development on Microsoft's Power Platform. They tackle traditional challenges associated with initializing apps and help maintain clean, efficient, and dynamic codebases. They've become especially useful in complex apps with large datasets, where performance optimization is key. This feature is a testament to the evolving nature of Power Apps, demonstrating Microsoft's commitment to providing tools that foster a more development-friendly ecosystem.
In September 2022, the named formula feature was introduced experimentally in Power Apps, becoming generally available by November 2023. This feature adds significant value to the platform by enhancing app performance, scalability, and maintainability. Named formulas allow creators to define an object or value once and subsequently use it throughout the app, much like variables or collections.
Named formulas help streamline Power Apps by reducing the need to overpopulate the OnStart property, which had been a common practice. Prior to named formulas, developers would move static data into variables, even though variables are meant for data that changes. Now, named formulas update in real time, reducing the need to reset variables or rebuild collections.
The article explains the benefits of using named formulas over traditional methods and notes the ease of keeping them updated. Additionally, Microsoft provided a detailed release note on Power Apps named formulas when they were first released, guiding users through their implementation.
One key detail for developers is to know where to locate named formulas, which is the same place as OnStart in the app editing interface. As for the naming convention, the blog suggests starting with consistent prefixes but still remains unsettled on a definitive standard, though "nf" is used as an example.
The author provides example data, pointing out the setup process for onboarding tasks in a Dataverse table and connecting to Office 365 Users. He highlights the importance of ending named formulas with a semicolon and offers some visual insight into their usage.
Specific use cases like retrieving logged-on user information, counting records, and building collections are discussed. Named formulas update automatically to reflect changes, unlike global variables which need their code to be rerun. Adopting named formulas can eliminate the need for duplicating code or repetitively adjusting the OnStart logic.
The blog post also covers themes and environment variable values, which traditionally are loaded at app start. By using named formulas, these configurations are effectively loaded only when necessary, optimizing app performance. However, certain operations, such as calling Power Automate flows, cannot currently be done with named formulas.
Deciding whether to use named formulas or traditional Power Fx, the author suggests that if data won't change during a session, named formulas are best. However, for changing data, OnStart or other properties may still be relevant. Importantly, the move to named formulas should be strategic and not simply shifting issues from one area to another.
Finally, the author invites feedback on the use of named formulas and offers assistance with any uncertainties regarding their application. Readers are encouraged to share their own experiences and subscribe for more Power Platform tips, though there's no request to subscribe or reference to promotional content in the summary provided.
PowerApps Named Formulas, Microsoft Power Apps Formulas, Power Apps Custom Names, Power Apps Formula Reference, Power Apps Naming Conventions, Create Named Formulas in PowerApps, Power Apps Expression Names, Power Apps Named Variables, Power Apps Formula Management, Power Apps Efficient Naming.