Filter function in Canvas Power Apps | Power Fx Formula Example

In case you are looking for how you use Search function as opposed to using Lookup() function in Power Fx in Canvas App, check this post!

Lookup Function – Lookup function in Canvas Power Apps | Power Fx Formula Example

Search Function – Search function in Canvas Power Apps | Power Fx Formula Example

Scenario

I have a Gallery control which is populated with Accounts data from Dataverse.

Then, I have another Gallery control to demonstrate how we can filter and pick records that satisfy one or more criteria in the Filter formula.

Filter() in Canvas Apps

Let’s see how we can use Filter in Canvas App based on the above scenario –

  1. Start by typing Filter while the target Gallery is selected under Items property and you’ll see that it’s a valid function in the list. And the first thing in the parameter after opening the bracket is the source.

  2. Now, Accounts is the table which I’m looking to filter on. I selected this from the Auto-complete when I types Accounts and then press comma (,) for the next parameter.

  3. Next, I’ll be asked the criteria to check for in order to Filter from the source data.
    Here, I want to select all the Account whose Annual Revenue is under 750,000.

    So, when I start typing the field name, the list will show the correct name which I can select.

  4. Then, I complete the formula.


  5. Optionally, I can have multiple criteria to be Filtered for.
    In this example, I’ll still keep only 1.

  6. Now, based on the completed formula, you can see below that the matching records have been filtered in the new Gallery control we added.

.And that’s how you can use Filter() function in Canvas App to select the records which match the provided criteria.

Here’s Microsoft Learn link for detailed criteria & documentation: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-filter-lookup#syntax?WT.mc_id=DX-MVP-5003911

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

Advertisement

Search function in Canvas Power Apps | Power Fx Formula Example

In case you are looking for how you use Search function as opposed to using Lookup() function in Power Fx in Canvas App, check this post!

Lookup function – Lookup function in Canvas Power Apps | Power Fx Formula Example

Filter function – Filter function in Canvas Power Apps | Power Fx Formula Example

Scenario

I have a Gallery control which is populated with Accounts data from Dataverse.

Then, I have another Gallery control to demonstrate how we can search and pick records that satisfy the criteria in the Seach formula.

Search() in Canvas App

Let’s see how we can use Search in a Canvas App based on the above scenario –

  1. Start by typing Seach while the Gallery is selected and you’ll see that it’s a valid function in the list. And the first thing in the parameter after opening the backet is the source.

  2. Now, Accounts is the table which I’m searching into. I selected this from the Auto-complete when I typed in Accounts and then, press comma (,) for the next parameter

  3. Next, I’ll be asked the text value of what I have to search for. It works like a “contains”. Anything that matches the pattern will be returned instead of the exact match.

  4. Finally, the last parameter is the Column on which the Search should be performed on. Since, I’m looking for Name of the Account in which I expect to find XYZ, I’ll select “Name” from the list.

  5. Now, the Formula is completed. I’ll get the below Formula on the new Gallery control’s Items property which has multiple records.

  6. And below is the result. All the rows that have XYZ in the Name of the Accounts will be populated in the new Gallery control I selected.


    And that’s how Search() function can be used to select records that have the phrase entered in the forumula.

Here’s Microsoft Learn link for detailed criteria & documentation: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-filter-lookup#syntax?WT.mc_id=DX-MVP-5003911

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

Lookup function in Canvas Power Apps | Power Fx Formula Example

Here’s how to think about and use the Lookup function in Canvas Power Apps!

Lookup is used to fetch a single record that matches a criteria from the source (usually a table)


Scenario

I have a Gallery control which is populated with Accounts data from Dataverse.

Then, I have a Textbox (Text Input) in which I’m going to pull up a field from a record from Dataverse table which matches a certain criteria.

Lookup() in Canvas App

Let’s see how we can use Lookup in a Canvas App based on the above scenario –

  1. Start by typing Lookup and you’ll see that it’s a valid function in the list. And the first thing in the parameter after opening the bracket is the source.
    As you can see, suggestions are also seen in the list below. Here, you have the select the Table / Entity from which you want to fetch the record.


  2. Now, Accounts is the table which I’m looking into. Hence, I’ll select that and press comma (,). Next, I’ll be asked the condition.
    Here, you need to mention what record you want to retrieve based on what criteria.

  3. So, I want to retrieve an Account whose “Account Name” is equal to <value>. So, below is how I write it.
    In this example, I’m trying to fetch an Account record whose ‘Account Namefield has value “Coffee House”

  4. Further, once I have this condition satisfied, what field I want to retrieve so that it can be shown in the Text Input box I have inserted (for which I’m writing this Lookup)


    So in this case, I want to retrieve the ‘Main Phone’ field.


  5. And once my formula is complete, I can end it with a closing bracket.
    And as you see the result below, the Main Phone from the matching criteria Account has shown up.


    And that’s how Lookup() function can be used to pick a record’s value based on a certain criteria.

Here’s Microsoft Learn Link for the same: https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-filter-lookup#syntax?WT.mc_id=DX-MVP-5003911

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

Enable Power Automate Pane in Canvas Apps Studio | Preview

Now, you can start creating Flows from within the Power Apps itself and add Power Automate as a Pane on the left hand navigation.

Let’s check out how –

Enable Power Automate Pane

In the App Studio, here’s how you can turn on the Power Automate pane –

  1. In the App Studio, you can see the Settings button, clicking on which will open up the Settings area.
    Go to Upcoming Features tab and look at the Preview section since this feature is still in Preview.

    You’ll find the Enable Power Automate pane option turned off by default.

  2. Before you turn it on, you’ll see the left hand menu doesn’t have a Power Automate icon/section added already.

  3. And when you Turn it On, you’ll see the Power Automate section added.

  4. Now, when you expand it, it appears like you can create a Flow from here.

  5. When you click on Create new Flow, you’ll get the option to start creating from a Template or create a new one like you usually do in Power Automate app itself.

  6. I clicked on Create from blank in the above step, you’ll then get the Flow editor right there and PowerApps as the trigger since this will be triggered from your Canvas Power Apps.

  7. Now, you can continue to build you Flow and once done, it’ll be available in the list to be used.

  8. And you can then use this Flow as per requirement.

Existing vs New Method

Let’s see the subtle difference between the existing and the new method -1

  1. Once you enable this, you’ll find 2 Power Automate buttons (Perhaps this will change in the near future)
    Once will open the new pane and the other existing one will open in the old way in context of the Screen being used.

  2. Additionally, the existing method will open the Power Automate portal itself in the new tab as opposed to opening the Flow in the Canvas Apps Studio itself.

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Showing Sandbox or Non Production Apps in Power App mobile app
  2. Create a Power Apps Per User Plan Trial | Dataverse environment
  3. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  4. Co-presence in Power Automate | Multiple users working on a Flow
  5. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  6. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  7. Call a Flow from Canvas Power App and get back response | Power Platform\
  8. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  9. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  10. Asynchronous HTTP Response from a Flow | Power Automate
  11. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  12. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

HTML Text control in Canvas Power Apps | Power Platform

As simple as a Label control, but supporting HTML formatting to it.

That’s HTML Text control in Canvas Power Apps. Let’s see how you can work with it.

HTML Text Control

Just like a Label control, you can pick and use the HTML Control from the Insert Menu.

In my simple use case, I’m using this to show the Ticker Symbol field from Dataverse in HTML formatted label i.e. HTML Text Control.

  1. Select the HTML Text from the Insert panel and it will appear where you want. In my case, in Gallery rows to show some data.


  2. By default, it will show you default values before you can start modifying the same.


  3. Then, since my use case is to dynamically have data in the HTML Text control, I’ll use the Concatenate method to form my HTML String.
    My HTML string contains some static text and then adding dynamic data to it for each row.



  4. Now, once I run the App, I’ll see how the HTML formatting with enrich the text displayed.


Usage

Interactive elements below are not supported.

  • <button>
  • <a>
  • <input>

Here’s the official MS Docs link for the same: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-html-text?WT.mc_id=DX-MVP-5003911

Hope this helped!

Here are some more Canvas Power Apps posts you might want to check –

  1. Transition effect on Gallery Items when hovered over in a Canvas Power App | [Quick Tip]
  2. Navigate Screen automatically based on Timer in Canvas Power App | Power Platform
  3. Search on multiple columns from a Dataverse table in a Canvas Power App Gallery control | Power Platform
  4. Call a Flow from Canvas Power App and get back response | Power Platform
  5. Enable Custom Code Components (PCF Controls) to be imported in a Canvas Power App | Quick Tip
  6. Retrieve Hashtags from Text in a Canvas Power App | Power Platform
  7. Rich Text Control for Canvas and Model-Driven App | Quick Tip
  8. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  9. Rating Control to represent data from Dataverse in a Canvas Power App | Power Platform
  10. Clear a field value & Reset Form in a Canvas Power App [Quick Tip]
  11. Get Dynamics 365 field metadata in a Canvas App using DataSourceInfo function | Common Data Service
  12. Implement character length validation in a Canvas Power App | Power Platform

Thank you!