Lookup function in Canvas Power Apps | Power Fx Formula Example (2024)

Skip to content

A closer look at Microsoft Dynamics 365.

HomeLookup function in Canvas Power Apps | Power Fx FormulaExample

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 function in Canvas Power Apps | Power Fx Formula Example (1)

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.
    Lookup function in Canvas Power Apps | Power Fx Formula Example (2)
  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.
    Lookup function in Canvas Power Apps | Power Fx Formula Example (3)
  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”
    Lookup function in Canvas Power Apps | Power Fx Formula Example (4)
  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)
    Lookup function in Canvas Power Apps | Power Fx Formula Example (5)

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

    Lookup function in Canvas Power Apps | Power Fx Formula Example (6)

  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.
    Lookup function in Canvas Power Apps | Power Fx Formula Example (7)

    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 PowerAutomate
  2. Select values from an array using Select action in a Power AutomateFlow
  3. Blocking Attachment Extensions in Dynamics 365CRM
  4. Upgrade Dataverse for Teams Environment to DataverseEnvironment
  5. Showing Sandbox or Non Production Apps in Power App mobileapp
  6. Create a Power Apps Per User Plan Trial | Dataverseenvironment
  7. Install On-Premise Gateway from Power Automate or Power Apps | PowerPlatform
  8. Co-presence in Power Automate | Multiple users working on aFlow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | PowerAutomate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | PowerAutomate
  11. Call a Flow from Canvas Power App and get back response | PowerPlatform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | PowerAutomate
  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 | PowerAutomate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | PowerAutomate
  16. Converting JSON to XML and XML to JSON in a Flow | PowerAutomate

Thank you!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Lookup function in Canvas Power Apps | Power Fx Formula Example (2024)
Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 6720

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.