Cos Function from Power Fx Using Power Apps

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. More Details

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

Reading this article, you can learn how to perform the Cos 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 in the browser for Power apps,

Create an account with your Organisation Mail ID and log in it, After login your Power Apps account,

Power apps home

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

Blank app

Next, Give the App name as PAPFCos and the Format as Tablet


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

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

Power function

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


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


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


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 Cos function.


Power Fx

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

Text label

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.


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

Power Apps

After clicking the Calculate Button, The Browser Display is.


The Apple iPhone Display is.

iPhone display

The Tablet Display is,

Tablet display

After clicking the Clear Button.

Clear button


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

Similar Articles