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

Create a Flyout menu for ribbons in Ribbon Workbench | XrmToolBox

Here’s how you can create Flyout menu in Ribbon Workbench.
Also, for most ribbon customization, you can edit using the Command Editor in Power Apps but this is in Preview at the time of writing this post –

  1. How to add low-code Power Fx buttons to model-driven apps (Commanding v2) – https://www.develop1.net/public/post/2021/07/25/commandingv2
  2. Comparison between Ribbon Workbench and Power Fx Command Buttons –
    https://www.develop1.net/public/post/2021/07/25/RibbonWorkbench-vs-PowerFx

Meanwhile, here’s how you can create a Flyout menu in Dynamics 365 CRM Ribbon using Ribbon Workbench in the XrmToolBox

Ribbon Workbench in XrmToolBox

In classic XrmToolBox style, here’s how you create a Flyout button. Given that you are aware of how to load the Entity’s ribbon in a solution and then onto the Ribbon Workbench, we’ll see at how we can create a button on Account Form –

  1. Insert the Flyout menu in the Ribbon where you want to insert this. In this case, in the Form ribbon of the Account entity.

  2. Once dragged, pick a Menu Section control and insert into the flyout canvas shown in screenshot below. Because all the Buttons will fall under that Buttons can’t be added directly into the Flyout menu.

  3. Now, you can name the Menu Section itself as show below –
    Note: In case if you named the Section correctly and it didn’t appear the first time, clicking on some other component and then clicking it back will show it correctly.

  4. Now, you can insert buttons underneath the section. In this case, I’ll add 2 buttons for Pause and Cancel.


  5. Make sure you populate the Command and the ModernImage icon for it’s icon so that the buttons are visible when you publish. Without a Command being attached to the Button, the button will not be visible.
    The final button layout will look like this.
    Note: In case if you named the Section correctly and it didn’t appear the first time, clicking on some other component and then clicking it back will show it correctly.

  6. Once ready, publish the changes and see. Your Flyout menu will be ready and will look like this!

Hope this was useful!

Here are some more XrmToolBox related posts which you might want to check –

  1. Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox
  2. Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure AD
  3. Find deprecated JS code used in your Dynamics 365 environment | Dynamics 365 v9 JS Validator tool | XrmToolBox
  4. Delete App Passwords created by other users in Office 365 | Multi-factor authentication
  5. Single record and multiple record auditing in Dynamics 365 to Audit record access | M365 Compliance
  6. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  7. Show custom ribbon button based on Security Role of the logged in User in Dynamics 365 | Ribbon Workbench in XrmToolbox
  8. Ribbon button visibility based on a field value in Dynamics 365 | Ribbon Workbench
  9. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  10. Pass Execution Context to JS Script function as a parameter from a Ribbon button in Dynamics 365 | Ribbon Workbench

Thank you!