This Power Apps tutorial will discuss creating a calculator in PowerApps. PowerApps create a calculator example that will show a simple calculator.
Create a calculator in PowerApps
Now, we will see how to create a simple calculator in Power Apps.
First, we will create a canvas app from the PowerApps.com site.
If you are new to PowerApps Canvas App, check out the below URLs:
- How to Create a Canvas app from SharePoint List in Power Apps
- Create a canvas app from Excel in Power Apps (Step by Step tutorial)
Here create an app, and you may choose Phone layout or Tablet layout.
Then, add the below controls to your screen: TextBox and Label from Power Apps input controls.
You can change the name of your control to recognize the control easily. Below is my screen, which looks like this after adding TextBox and Label.
Here I have set the background Image as black Image and changed the button color to orange and the Textbox to blue.
Next, click on the first textbox and go to the Onchange property and set the variable as N1. This means whatever value you enter in the textbox, it will store in the N1 variable.
You can visit the Microsoft site to learn more about creating a variable in PowerApps.
The same step you have to follow here, go to the Onchange property of your textbox and Set the value in the N2 variable. This means whatever the value you enter in the textbox, it will store in variable N2.
Next, click on the Plus button and go to the OnSelect property and store the N1 and N2 values in a result variable. So do the same for the other button as well.
+ button -> UpdateContext({result: N1 + N2 });
- button -> UpdateContext({result: N1 - N2 });
* button -> UpdateContext({result: N1 * N2 });
/ button -> UpdateContext({result: N1 / N2 });
Next go to the Output Textbox and set the result in Textbox property Text.
After set everything, Run the apps and see the output as below.
This is a simple Power Apps calculator.
You may like the following Power Apps tutorials:
- PowerApps form benefits for SharePoint
- How to view PDF files using PDF Viewer in PowerApps
- How to Play Microsoft stream Videos in Power Apps
- How to create a PowerApps Canvas app from Excel OneDrive for Business data source
- PowerApps Combobox SharePoint List Example
- Fetch azure groups in PowerApps using PowerApps Azure AD Connectors
- PowerApps Examples: Restaurant management system
- Fetch Outlook email details Power Apps using Office 365 Outlook Connector
In this tutorial, we will discuss how to create a simple calculator in Power Apps.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).