Cot 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 Cot function returns the cotangent of its argument, an angle specified in radians. The General syntax is Cot(Radians).

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

 Power Apps account

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

 Canvas app

Create

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

App name

PADCot

Step 3. To test the Cot function, First Rename the Screen name as SCRPAD.

 Cot function

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

 Label control

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

Enter the Radians Value

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

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 the Cot function in Power Fx.

Button control

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

Name property

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.

Finally, the form design looks like this.

OnSelect  Property

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

Power Apps Studio

After clicking the Calculate Button.

The Browser Display is,

Browser Display

The Apple iPhone Display is,

Apple iPhone Display

The Tablet Display is,

Tablet Display

After clicking the Clear Button,

Clear Button

Summary

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


Similar Articles