Power Apps is a suite of apps, services, connectors, and data platforms that provides a rapid application development environment to build custom apps for your business needs. Click here for More Details.
Reading this article, you can learn how to perform arithmetic operations like Addition, Subtraction, Multiplication, Division 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 Organization Mail ID and login it, After login your Power Apps account,
Step 2
First, Click Create (+ ) and Select the Canvas app from blank,
Next, Give the App name as PBArithmatic and Format as Phone.
Now, In the Power Apps studio environment, Select the Create a form option,
Step 3
To perform arithmetic operations, First Rename the Screen name as ScrArith and Rename the Form name as FrmArith,
Next, Insert a Label control and set the Name and Textproperty as LblNo1 and FirstNumber.
Similarly, Insert a Label control and set the Name and Textproperty as LblNo2 and SecondNumber.
Insert 2 TextInput control and set the Nameproperty as TxtNo1 and TxtNo2 and Formatproperty as Number.
Insert 2 Label controls and set the Nameproperty as LblResult and LblRes and Textproperty as Result and “” for displaying Results.
Insert 4 Button controls and set the Nameproperty as BtnAdd, BtnSub, BtnMul, BtnDiv and Textproperty as ADD, SUB,MUL, DIV for performing Arithmetic Operations.
Set the Following Rules code in the Button controls BtnAdd, BtnSub, BtnMul, BtnDiv in OnSelect Property in Action (click the Advanced) as,
- UpdateContext({Result: TxtNo1+TxtNo2})
- UpdateContext({Result: TxtNo1-TxtNo2})
- UpdateContext({Result: TxtNo1*TxtNo2})
- UpdateContext({Result: TxtNo1/TxtNo2})
Next, we can assign the LblRes Text property value as a Result of Button controls.
Insert a Button control and set the Nameproperty as BtnClear, Textproperty as Clear and OnSelect Property in Action (click the Advanced) as Reset(TxtNo1); Reset(TxtNo2); UpdateContext({Result: 0}) for reset the Text and Label control.
Finally, the form design looks like,
Step 4
Now we can see the preview of your App in Power Apps Studio,and output of the PBArithmaticis,
After clicking the ADD Button,
After clicking the SUB Button,
After clicking the MUL Button,
After clicking the DIV Button,
After clicking the Clear Button,
Summary
Now, you have successfully created and tested your arithmetic operations - PBArithmaticin Power Apps Studio environment.