web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery items based on...
Power Apps
Unanswered

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? 

I have the same question (0)
  • DevendraSingh Profile Picture
    144 on at

    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

     

     

  • Verified answer
    v-siky-msft Profile Picture
    on at

    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

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard