Announcements
Hi all.
I'm trying to create a mechanism where if I click on a button in Gallery2, it navigates to another screen and selects the associated item in Gallery1. The data is in CDS and there's a lookup field associating Gallery2's record with a record in Gallery1. I've got the navigation part covered, but I'm not sure how to select the specific gallery item. I know of Select(), but that requires a row ID and I'm not sure how to obtain that based on a value from a lookup column. Any ideas?
Hi @ell10706 ,
On the gallery item click you can set a variable Set(varSelectedItem,Thisitem) and can utilize this variable for any values from the selected gallery item.
Eg : varSelectedItem.ID will give you selected items ID
Thanks, Priyanka. I guess I'm confused how I'd get the item's ID in the first place, since my search is originating in Gallery 2.
I.e. I select Item 1 in Gallery 2 (which is associated with Item 3 in Gallery 1). The screen should change to show Gallery 1 and select Item 3.
How can I derive the Item ID of Item 3 based on what I select in Gallery 2?
@ell10706
Lets take it step by step
1. select Item 1 in Gallery 2 (which is associated with Item 3 in Gallery 1) - In the gallery 2 button where you are navigating to Gallery 1 add code
Set(varSelectedItem,Thisitem)
2. Gallery 1 and select Item 3. - In the gallery 1 items Filter(gallery1item, ID=varSelectedItem.ID)
Thank you, I'll give this a shot. I should clarify, the items from Gallery2 and Gallery1 are from different tables, but are related by a lookup field. Will this method still work?
Yes, It should work instead of ID mention the related field value.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Sweet. I see what you're getting at here and it does technically work.
I should clarify that both galleries are already filtered by a search box and drop-down, so adding this logic to the mix might complicate things. I also noticed that this won't select the item from the filtered gallery, just make it the only result. Users would still need to click on the item to view it (I show details about the item in a form adjacent to Gallery 1). Is there a way we can make the desired item actually selected within the gallery without adding additional filters?
Yes, you can. Please check the Is selected property of gallery and add the query there instead of Filtering the gallery1.
Got it, thank you. Are we talking about the OnSelect property? I only see that and "Selectable" as properties in the gallery.
Sorry, If you add a rectangle in the gallery and try the below code in the Fill it should work.
If( Condition: SelectedValueGallery2=Gallery1,RGBA(255, 191, 0, 0.1),RGBA(255, 255, 255, 1))
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
wolenberg_ 119 Super User 2026 Season 1
WarrenBelz 107 Most Valuable Professional
Haque 103