Power Apps Guide - Formulas - A beginners guide on how to create and call user-defined functions (UDFs) - Power Apps Guide
Until now, one of the most frustrating limitations of Power Apps was the lack of support for building reusable Power FX functions.A common way to apply the same formula in multiple places was to copy and paste the code. Because this results in a lot of duplication, it's not an effective or maintainable way to build an app. The great news is that Microsoft has started to roll out the 'user-defined function' feature. This enables us to define parameterised, reusable blocks of formula that we can call throughout an app. This post describes how to get started with user-defined functions and provides some examples of some simple user-defined functions. How to enable the User-Defined Function FeatureTo begin using this feature, the first step is to enable the feature in the app settings. There are two settings to enable.The first is to enable the "New analysis engine"feature, which is a prerequisite to enabling "User-defined functions". Once the "New analysis engine" setting is enabled, we c...