Skip to main content
Community site session details

Community site session details

Session Id : f2R9lHIII6fBW4LaQdHgyy
Power Apps - Building Power Apps
Unanswered

Power Apps equation referencing a lookup field in a Dataverse table

Like (0) ShareShare
ReportReport
Posted on 12 Jun 2023 15:23:47 by 6

I'm working on a Canvas App to track client interactions and contacts, and my main data sources are Dataverse tables.  My home screen has a gallery on it that shows all the meetings from all clients, and I want to be able to filter this gallery by client name.  The issue I'm having is that no matter how I try it, I can't reference the field anywhere in the gallery associated with the client/project name.  I'm thinking it may be because that field is a Lookup field in my Dataverse table, but I'm not sure how to circumvent that.

gnorman_2-1686583224816.pnggnorman_1-1686583205012.png

Is there a way within my canvas app gallery to reference that field? Or have I set up that field incorrectly?

 

 

Categories:
  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 14 Jun 2023 at 00:06:44
    Re: Power Apps equation referencing a lookup field in a Dataverse table

    Hi @gnorman ,

     

    Yes this is possible with either a Combo Box control or a Dropdown control.

     

    For example, in the Items property of the Dropdown or Combo Box control, use:

     

    Sort(
     Ungroup(
     Table(
     {
     DropdownOptions: Distinct(
     'Your Data',
     'Your Field'
     )
     },
     {DropdownOptions: ["#All"]}
     ),
     "DropdownOptions"
     ),
     Value
    )

     

    In the Items property of your Gallery, use:

     

    Filter(
     'Your Data',
     //Dropdown1.SelectedText.Value = "#All" || 'Your Field' = Dropdown1.SelectedText.Value //use for a dropdown control
     ComboBox1.Selected.Value = "#All" || 'Your Field' = ComboBox1.Selected.Value //use for a combo box control
    )

     

    Given there are multiple Solutions to different questions in this thread, please mark them as Solved if they answered your questions. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

  • gnorman Profile Picture
    6 on 13 Jun 2023 at 15:51:49
    Re: Power Apps equation referencing a lookup field in a Dataverse table

    This worked, thank you.  I have one additional question: Is there any way you know of to create an "all" option for a drop-down control?  I know with a combo box I can just add all the members of a particular field, but if I have 100 clients that could get tedious.  I tried using an If equation in conjunction with the Filter function, but I couldn't figure out how to add "all" or something simliar to the drop-down.

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 12 Jun 2023 at 22:15:37
    Re: Power Apps equation referencing a lookup field in a Dataverse table

    @gnorman,

     

    To Filter a Gallery using a related Dataverse column on a many-to-one relationship:

     

    1. Create either a Combo Box control or Dropdown control and set the Items property to the Client table.

    2. Select the Field you want to see using the Combo Box properties pane and disable Allow multiple selections

     

    Amik_0-1686607925322.png

     

    3. For the Gallery, apply the following expression. Note the expression is the same for either a Dropdown control or a Combo Box control:

     

     

     

    Filter(
     Meetings,
     'Project Name'.'Client Name' = Your_ComboBox.Selected.'Client Name'
    )

     

     

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

     

     

  • gnorman Profile Picture
    6 on 12 Jun 2023 at 20:36:42
    Re: Power Apps equation referencing a lookup field in a Dataverse table

    Thank you, that worked for displaying the data within that field within the gallery.

     

    Now, what I'm trying to figure out is how to use that field as a filter/search field within the gallery.  I've tried using a dropdown control:

    gnorman_1-1686601764538.png

    But I couldn't get the drop down to populate using the entries in that field.

     

    So, I tried using a search box and a search equation within the gallery:

    gnorman_2-1686601852428.png

    and this didn't work either.  Now, in this one, when I was typing the equation, I was prompted to use the schema/logical name for the field:

    gnorman_3-1686602075662.png

    Again, with any of the other fields from this table, this works but I'm struggling with the Project Name field.

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 12 Jun 2023 at 20:01:24
    Re: Power Apps equation referencing a lookup field in a Dataverse table

    Hi @gnorman ,

     

    Add a period/full stop after 'Project Name' (your Lookup column) to return fields from the related table.

     

    Amik_0-1686600045695.png

     

    ------------------------------------------------------------------------------------------------------------------------------

     

    If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.

    If you like my response, please give it a Thumbs Up.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Loading complete