Tan function from Power Fx using Power Apps

Power Apps is a suite of apps, services, connectors, and a data platform that provides a rapid application development environment for building custom apps for your business needs. For more details, visit https://docs.microsoft.com/en-us/powerapps/powerapps-overview.

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

The Tan function returns the tangent of its argument, an angle specified in radians. The General syntax is Tan(Radians).

Reading this article, you can learn how to perform the Tan 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.

How to perform Tan function from Power Fx using Power Apps

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. After login your Power Apps account,

login your Power Apps account

Step 2

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

Select the Canvas app from blank

Blank Canvas app

Next, give the App name as PAPFTan and the Format as Tablet

Blank Canvas app

Step 3

To test the Power function, First Rename the Screen name as SCRPFx

test the Power function

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

Insert a Label control

Next, Insert a Label control and set the Name and Text property as LblRad and " Enter the Radians Value:"

Insert a Label control

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

Insert a TextInput control

Insert a Button control and set the Name property as BtnCal and Text property as Calculate and set OnSelect action as UpdateContext({RES:(TxtRad)}); for testing Tan function in Power Fx

Insert a Button control

Insert Label control and set the Name property as LblRes and Text property as "Tangent of "& RES.Text &" radians is : " &Cos(RES.Text) for displaying Results

Insert Label control

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

Insert a Button control

Finally, the form design looks like,

form design

Step 4

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

Tan function from Power Fx using Power Apps

After clicking the Calculate Button,

The Browser Display is,

Tan function from Power Fx using Power Apps

The Apple iPhone Display is,

Tan function from Power Fx using Power Apps

The Tablet Display is,

Tan function from Power Fx using Power Apps

After clicking the Clear Button,

Tan function from Power Fx using Power Apps

Summary

You have successfully tested the Power Fx – Tan function in the Power Apps Studio environment.


Similar Articles