Pragmatic Works Nerd News

Named Formulas in Canvas Apps: CONSTANTS AREN'T VARIABLES

Written by Nate Halliwell | Jul 24, 2026

In this training video, Nate Halliwell from Pragmatic Works explains how developers and app builders can simplify their work by using named formulas in Canvas Apps. Historically, values that never change—such as a user’s email address, a manager’s details, or the current quarter—were stored as variables. But now, thanks to Microsoft’s named formulas feature, these can be handled more efficiently as constants.

 

Why Constants Matter

Nate begins by comparing constants in programming to values in apps that do not change during use. Examples include:

  • User’s name or email address
  • Manager’s name and email
  • First day of the current month
  • The current quarter of the year

Traditionally, Canvas Apps required storing these in variables through the OnStart property. However, constants make more sense since they do not vary.

Introduction to Named Formulas

Microsoft introduced named formulas about 18 months ago, but they were initially marked as experimental. Recently, they moved into the preview stage, making them stable enough for practical use. This update means app creators can now confidently use named formulas without worrying that the feature will be removed.

Enabling Named Formulas

To start using named formulas:

  1. Open Settings in your app.
  2. Navigate to Upcoming Features.
  3. Search for Named Formulas and enable it under the Preview tab.

Creating Named Formulas

Named formulas are created under the Formulas property of the app. The syntax is straightforward:

UserEmail = User().Email;

Nate emphasizes the importance of ending each formula with a semicolon, even if it’s the only formula present.

Using Named Formulas

Once created, these formulas are immediately available for use throughout the app, without requiring OnStart initialization. For example:

  • User Email: Simply reference UserEmail and it appears instantly in IntelliSense.
  • Manager: Defined as a record using Office365Users.ManagerV2(User().Email), allowing access to fields like .DisplayName and .Mail.
  • First Day of Month: Set as a constant using DateValue() functions to dynamically calculate the first day of the current month.
  • Current Quarter: Calculated by dividing the month by three and rounding up, giving accurate quarterly values.

Working with Records and Tables

Named formulas aren’t limited to simple text or numbers. They can also hold:

  • Records – such as a manager’s details
  • Tables – for example, a manager’s direct reports

This flexibility makes them powerful tools for building scalable apps without cluttering the OnStart property.

Benefits of Named Formulas

  • Eliminate unnecessary variables for static values
  • Improve performance since no OnStart execution is required
  • Provide cleaner, more maintainable apps
  • Allow reuse of constants across screens without duplication

Conclusion

Nate wraps up by highlighting how named formulas bridge the gap between traditional programming practices and Canvas Apps. Developers and app makers can finally declare constants, making applications easier to manage, more efficient, and less error-prone.

Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Canvas Apps and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.