cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RomanScheinher
Regular Visitor

Change gallery selected item

Hello,
I need help how to change the actually selected item in Gallery.

I have a screen with basic gallery filled with data from a collection. And the second screen with detail referencing Gallery.Selected item. On the gallery screen I need to have a button to go to the detail of one specific item (based on logical value in column of source collection, only one item has it "true" at any time).
I think this is right way how to achieve that:

ForAll(Gallery1.AllItems, If(Started, Select(Gallery1, 1, [@NextArrow])))
but based on documentation of "Select" function:
- I don't have the row number (above is hardcoded #1) and I don't want to add another column.
- I don't know how to reference the specific row whithin the ForAll, where the condition is true, to fire Select(NextArrow_OfTheRightRow).

I still hope there is any simple solution, easier than adding column with row number or holding the selected item record in separate variable.

 

Thank you in advance for any help

5 REPLIES 5
JR-BejeweledOne
Super User
Super User

Are you wanting this to happen automatically or are you wanting it to happen when someone selects the item?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

In OnSelect of the button I navigate user to detail screen of the gallery's Selected item. So, before navigate, I need to change the record which is the gallery's Selected referencing to.

I have to admit I don't quite understand that logic.   Is it because once they have navigated to the detail screen you don't want them to see that item in the gallery anymore?

 

What are they doing on the detail screen?   If they are updating the item in some way, can you use that update to filter the gallery so it no longer shows the item in question?



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

There is nothing to do on the detail screen. It is standard list -> detail behavior. List is the gallery component, when you click on any item you are redirected to detail screen of this item. But in addition to this, under the gallery is one more button and when user clicks on it, I want to show detail of one specific item based on some conditions.

On the detail screen there are some labels showing text like Gallery1.Selected.Title and this is why I need to change the "Selected" to show detail of the correct item after user click the button under list / gallery.

 

Sorry for my explanation, I am doing my best 🙂 Maybe I am trying to achieve something impossible or doing it in wrong way.

You would have to update your form (detail item) 'Item' property with an if statement, that would display either the gallery.selected item or the item that was selected by the other button.

 

Since I don't know what your OnSelect formula is for the button, I can't give you a better example.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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
Top Kudoed Authors
Users online (2,432)