Power Function from Power Fx Using Power Apps

Power Apps is a suite of apps, services, connectors, and data platforms 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 Power function returns a number raised to a power. It's equivalent to using the ^ operator. The General syntax is Power( Base, Exponent ).

Reading this article, you can learn how to perform the Power 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 log it, After login your Power Apps account.

Create

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

Blank

Next, Give the App name as PFAPower and the Format as Tablet.

App name

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

Form Option

Step 3. To test the Power function, First Rename the Screen name as ScrPower.

Screen

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

Text Label

Next, Insert a Label control and set the Name and Text property as LblBase and "Enter The Base Value:"

Base Value

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

Format

Next, Insert a Label control and set the Name and Text property as LblExp and " Enter The Exponent Value:"

Text

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

Text input

Insert a Button control and set the Name property as BtnCal and Text property as Calculate and set OnSelect action as UpdateContext({RES:(TxtBase)});UpdateContext({RES:(TxtExp)}); for testing Power Power Fx.

Calculate

Insert Label control and set the Name property as LblRes and Text property as "The Power Value is:" &Power(TxtBase.Text, TxtExp.Text) for displaying Results.

Label

Insert a Button control and set the Name property as BtnClr, Text property as Clear, and OnSelect Property in Action as Reset(TxtBase); Reset(TxtExp); UpdateContext({LblRes:""}); for reset the Textboxes and Result

Button

Finally, the form design looks like this.

Form Design

Step 4. Now we can see the preview of your App in Power Apps Studio, and The output of the PFAPower is.

Output

After clicking the Calculate Button.

The Browser Display is.

Browser

The Apple iPhone Display is.

Iphone

The Tablet Display is.

Tablet

After clicking the Clear Button.

Clear

Summary

Now, you have successfully tested the Power Fx – Power function in the Power Apps Studio environment.


Similar Articles