User-defined functions (UDFs) are a new experimental feature in Power Apps that allow developers to write a formula once and reuse it multiple times throughout an app. This approach brings modularity, reusability, and cleaner formulas to Power Apps development.

Key Points

Caution

Since UDFs are not yet in the final release , they should not be used in production apps . Using them in critical applications could lead to unexpected behavior or compatibility issues. It's best to wait for the official release before leveraging this feature in production environments.

Enable the Power Apps User Defined Function (UDF) feature

  1. Go to Settings

  2. Upcoming features

  3. Select Preview

  4. Enable New Analysis Engine

  5. Select Experimental

  6. Enable User-defined functions

  7. Once these features are enabled, save and refresh the application.

Screenshot 2025-10-03 131037Screenshot 2025-10-03 131102

Creating and calling a Power Apps User-Defined Function (UDF)

Creating UDF

Screenshot 2025-10-03 134726

I have created a validateControls function that accepts a text parameter and returns a Boolean value indicating whether the input matches a specific pattern. In this example, the function allows only lowercase and uppercase letters; any other characters will cause it to return false.

  
    validateControls(controlValue: Text): Boolean = IsMatch(controlValue, "^[a-zA-Z]+$");
  

Syntax

FunctionName (Parameter1: DataType1, Parameter2: DataType2, ...): ReturnType = Formula

Calling UDF

Once created, you can call the UDF anywhere in your app. Here, we add a Textbox and a Label control to the screen and set the Text property of the label. The Label dynamically displays true and false based on input.

  
    "Text is valid: " & If(validateControls(TextInput1.Text), "true", "false")
  
Screenshot 2025-10-03 131725

Advantages of UDFs

Limitations