Example functions (preview)

[This topic is pre-release documentation and is subject to change.]

The article helps you get started with functions in Microsoft Dataverse by integrating them into your apps. You'll understand that the authoring experience includes authoring Dataverse custom APIs backed by Power Fx expressions, which can trigger actions internal or external to Dataverse.

Important

  • This is a preview feature.
  • Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.

Test a Power Fx expression

You can test a Power Fx expression to verify it's working. This example uses the Abs() function to return the non-negative value of its argument. If a number is negative, Abs returns the positive equivalent.

  1. Sign into Power Apps and select Functions from the left navigation. If the item isn’t in the side panel pane, select …More and then select the item you want. Open the unmanaged solution where you want to add a function.

  2. Select New function.

  3. On the New function pane, enter a Display name, such as Return non-negative value, and Description for your function.

  4. Create a New output parameter to validate expected behavior, such as a string. For example, enter the Name of your New Output parameter Out.

  5. Optionally, use input parameters to make testing easier, that makes sense with the formula. In this example, no input parameters are used.

  6. In the Formula box, wrap the Out parameter in curly brackets: {Out: "" } For example, you can test the Abs() function, which uses -5 to return the absolute value 5.

    {Out: "Abs(-5)=5:"& Text(Abs(-5) = 5) } Abs function that uses the number 5.

  7. Select Save.

To test the function, select the function and then select Test on the command bar. Then select Play. Based on the formula used in this example function, the response returns the value 5 as true.

Response from Power Fx Abs formula

Input validation and custom errors

Send in-app notifications based on an instant action

This and more samples coming soon.