Abs function from Power Fx using Power Apps

Power Apps is a suite of apps, services, connectors, and data platform that provide a rapid application development environment to build custom apps for your business needs.

More Details https://docs.microsoft.com/en-us/powerapps/powerapps-overview.

Power Fx is the low-code language that will be used across the Microsoft Power Platform. It's a general-purpose, strong-typed, declarative, and functional programming language.

The Abs function returns the non-negative value of its argument. If a number is negative, Abs returns the positive equivalent.

Reading this article, you can learn how to perform the Abs function from Power Fx using Microsoft Power Apps. Also, you will be able to learn Button control, Label control, and TextInput control in the Power Apps environment.

Step 1

Open the URL https://powerapps.microsoft.com/en-us/ in the browser for Power apps,

Create an account with your Organisation Mail ID and login it; after login your Power Apps account,

Abs function from Power Fx using Power Apps

Step 2

First, Click Create (+ ) and Select  the Canvas app from blank

Abs function from Power Fx using Power Apps

Abs function from Power Fx using Power Apps

Next, Give the App name as PAPfAbs and Format as Tablet

Abs function from Power Fx using Power Apps

Now, In the Power Apps studio environment, Select the Create a form option,

Abs function from Power Fx using Power Apps

Step 3

To test the Abs function, First Rename the Screen name as SCRPowerFx

Next, Insert  a Label control and set the Name and Text property as LblTitle and Abs function in canvas App using PowerFx with Power apps

Abs function from Power Fx using Power Apps

Next, Insert  a Label control and set the Name and Text property as LblInput and Enter Your Input Value

Abs function from Power Fx using Power Apps

Insert  a TextInput control and set the Name property as TxtInput and Format property as Number

Abs function from Power Fx using Power Apps

Insert  a Button control and set the Name property as BtnAbs and Text property as Abs and set OnSelect action as UpdateContext({RES:(TxtInput)}) for testing Abs Power fx

Abs function from Power Fx using Power Apps

Insert Label control and set the Name property as LblRes and Text property as "The Absolute Value is :  " &Abs(RES.Text) for displaying Results

Abs function from Power Fx using Power Apps

Insert  a Button control and set the Name property as BtnClr, Text property as Clear and OnSelect  Property in Action as Reset(TxtInput); for reset the Text and Label control

Abs function from Power Fx using Power Apps

 

Finally, the form design looks like,

Abs function from Power Fx using Power Apps

Step 4

Now we can see the preview of your App in Power Apps Studio, and The output of the PAPfAbs is,

Abs function from Power Fx using Power Apps

After clicking the Abs Button, The Browser Display is,

Abs function from Power Fx using Power Apps

The Tablet Display is,

Abs function from Power Fx using Power Apps

The Apple iPhone Display is,

Abs function from Power Fx using Power Apps

After clicking the Clear Button,

Abs function from Power Fx using Power Apps

Summary

Now, you have successfully created and tested the Power FxAbs function in the Power Apps Studio environment. 


Similar Articles