cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tlevine
Kudo Commander
Kudo Commander

Gallery Lookup to Collection

Hi All - 

 

I am having an issue where my Lookup into a collection is not working.

 

In a gallery, I have one field which is looking up into a Collection and trying to pull in a field from the collection, using the code below:

 

LookUp(PlannerCollection, ThisItem.StaplePlannerID = Label22_25.Text, 'Planner Name')

 

My issue is that the record of 'Planner Name' continues to be duplicated in the gallery and does not appear to be working.

 

Any help? 🙂

 

In the attached image, I am trying to look up the # in the far right column of the gallery and return the name of the user associated with that number from my collection which consists of Name and #.

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Delid4ve
Impactful Individual
Impactful Individual

What is your gallery items property set to?
I would also use first(filter) as i see bigger performance improvements with this:

First(filter(othercollection,field = thisitem.field)).Fieldfromothercollection

View solution in original post

9 REPLIES 9
rebeccas
Community Champion
Community Champion

Label22_25.Text is the label in your gallery?

 

If so that is called the same thing in every line of your gallery so you will need to change that to ThisItem.FieldName and the other side actually doesn't need ThisItem...it can just be the field name from your collection. Basically the ThisItem portion need to be referring to the data source of the gallery you are in.

 

Thanks for the quick reply! 

 

I changed my formula to this: LookUp(PlannerCollection, 'Planner ID' = ThisItem.StaplePlannerID, 'Planner Name')

 

but now there are no results in the gallery. Thoughts?

rebeccas
Community Champion
Community Champion

Hmmm.....Isn't this just a label in your Gallery? That shouldn't change what shows in your Gallery at all. 

 

Is this LookUp on a label or did I miss something?

Yes, I am  looking up the value from a label in the gallery to find a value from a collection and bring that back to another label in my gallery. Sorry if that was confusing but did that help explain?

 

 

Delid4ve
Impactful Individual
Impactful Individual

What is your gallery items property set to?
I would also use first(filter) as i see bigger performance improvements with this:

First(filter(othercollection,field = thisitem.field)).Fieldfromothercollection

View solution in original post

Hi - my gallery is set to the full range of items in my SQL table (I have not set a filter to it yet since I am just in test mode now with very few records). 

I tried this: First(Filter(PlannerCollection, 'Planner ID'= ThisItem.StaplePlannerID)).'Planner Name' but I still do not get any results.

 

Thoughts?

Delid4ve
Impactful Individual
Impactful Individual

The labels are both in the gallery?
The data definitely is linked that way?
You have checked there is data in both collections?
The gallery items property is set to what??

I just double checked my collection and now it works! Thank you to all in the community for the help!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,653)