Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Gallery items based on Lookup Field

(0) ShareShare
ReportReport
Posted on by

Hello Experts,

 

In my canvas app, I am using

1) Users Entity

2) Custom entity called Routes

 

Routes has a lookup field called Courier that has Users Entity as a related entity. 

 

I have two requirements:

1) I want a gallery that shows the list of distinct couriers as Routes can have more than one row associated with one courier.

2) I want to have Search text box as well which can search couriers bases on Full Name for example which is a field in Users Entity. 

 

What I have tried so far:

1) I have not been able to do Users.Routes (It says the specified column is accessible in this context)

2) Distinct(Routes, Courier).Result (This works for requirement #1 but I do not know how to make search work (requirement #2))

 

So, is there a way to get only the distinct records from Users entity that are referenced in Routes entity? 

Categories:
  • Verified answer
    v-siky-msft Profile Picture
    on at
    Re: Gallery items based on Lookup Field

    Hi @Anonymous ,

     

    Here is a simple workaround, create a new column by AddColumns function to store the FullName of couriers from User Entity.

    Please try to put the following code to Gallery.Items property:

    Search(Distinct(AddColumns(Routes,"UserFullName",Courier.'Full Name'),UserFullName),SearchTextInput1.Text,"Result")

    Set Text property of Label inside Gallery: ThisItem.Result

    Snipaste_2020-05-27_13-45-09.png

    Hope this helps.

    Sik

     

  • DevendraSingh Profile Picture
    144 on at
    Re: Gallery items based on Lookup Field

    Hi,

    Requirement 1: Use the formula Distinct(Routes, Courier) to get the distinct couriers, and in the gallery use the formula ThisItem.Result.'Full Name' to display the full name.

    Requirement 1 & 2: Following are the steps,

    • Step1: Create a collection to store the above query result, i.e. Collect(colItems, ForAll(Distinct(Routes, Courier), {'Full Name': Result.'Full Name', 'First Name': Result.'First Name'}))
    • Step2: Add a text box control
    • Step3: Add a gallery control, and write the formula Search(colItems, TextBox.Text, "Full Name") on items property

    Please click Accept as Solution, if this solution solved your issue. If this post was useful, please consider giving it Thumbs Up.


    Thanks & Regards,

    Devendra Singh

     

     

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 15 Super User 2025 Season 1

Overall leaderboard

Featured topics