PL 400: Implement complex formulas to manage control events and properties (Create canvas apps)

The most interesting factor of Power Platform is that anyone can design/build apps. To simplify the complexity of the code, Microsoft introduced formulas that work like Excel. With the help of formulas, the user can enhance the functionality, performance and user experience in Power Apps.

According to Wikipedia:

In Science,  a formula is a concise way to expressing information symbolically, as a mathematical formula or a chemical formula.


In computer science, formula is used as the term for computing, but in power apps, the user can calculate and take action as well as alter the user experience. These formulas are easily included with controls and used with events.

In March 2021, Microsoft has now extracted these formulas and syntax into an independent language called Power Fx. In development, there are two points that may be worth noting:

  • This is the common language that Power will use across products in the platform.
  • It is open source.

Below formulas are frequently used in the Canvas Apps:

Conditional Formatting:

Apply conditional formatting to app is a great way to enhance the look and feel as well as user experience.

If(Sum(Value(TextInput1.Text), Value(TextInput3.Text)) > 50, Color.DarkGreen, Color.Darkred)

Function for Validating Data:

IsBlank -- This function checks a field, property, or variable to see if the result is blank. If the object is blank, then the function returns true.

IsBlankOrError -- This function checks whether an expression is blank or results in an error, and returns true or false.

IsEmpty -- This function checks a table of data to see if it contains records. If the table is empty, then the function returns true.

IsMatch -- This function checks a field, property, or variable to determine if the result matches the specified pattern. If the pattern is a match the function returns true. For details about the various matching patterns, see IsMatch function in Power Apps.

IsNumeric -- This function checks a field, property, or variable to determine if the result is numeric. If the object is numeric, then the function returns true.

IsToday -- This function checks if a date or time value is between midnight today and midnight tomorrow. If the date or time value is within that range, the function returns true.

Power Apps includes the following counting functions:

Count counts the number of records that contain a number in a single-column table.

CountA counts the number of records that aren't blank in a single-column table. This function includes empty text ("") in the count.

CountIf counts the number of records in a table that are true for a logical formula. The formula can reference columns of the table.

CountRows counts the number records in a table.

Count and CountA only support single-column tables, and that is the only argument they accept.

CountIf accepts a table and then the logical formula to process. It then returns a count of all of the records that match the logical formula.

CountRows accepts only a table as an argument and then returns a count of the number of rows in that table.

Change the screen that's displayed : Back and Navigate function

Control a Signal : Enable and Disabled function

Refresh, Update or Remove items in a Data Source: Refresh, Update, Updateif, Patch, Remove, Removeif

Update a context variable: UpdateContext function

Create, Update or rename items in a collection : Collect, Clear, ClearCollect

The Not Function returns the opposite of true or false.


Comments

Popular posts from this blog

Powering Up Your Analytics: Exploring Power Query in Power BI

Power App Component Overview : Canvas App vs Model-Driven App

Exam PL-400: Microsoft Power Platform Developer