cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
samhegartyunsw1
Level: Powered On

Navigate to next filtered gallery item

I've created a gallery based on a filtered collection.  The gallery item references a Variable I've setup in order to filter e.g. 

UpdateContext({FilteredList:Filter(NominationCollection, NominationType = "team" || NominationType = "individual" 
)});

What I now want to do is have someone navigate to the next item in the gallery once they've clicked through to view the item details. This would save them having to go back to the main gallery screen then click on the next item manually.

 

Is there a way to do this? I'm thinking if it somehow gave each item in the gallery a number in order which it appears and then setup a button to load the next item when selected.

 

Thanks.

5 REPLIES 5
Community Support Team
Community Support Team

Re: Navigate to next filtered gallery item

Hi @samhegartyunsw1 ,

 

I think this cannot be achieved so far, as the context variable would be different numbers of records according to the filtered result.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
samhegartyunsw1
Level: Powered On

Re: Navigate to next filtered gallery item

@v-monli-msft would there be a way when I apply the filter to update a column to give each record a number (starting at 1 then going sequentually) so there's something to reference? Then I could update a button to move to the +1 record?

Super User
Super User

Re: Navigate to next filtered gallery item

I'm not sure if you can adjust this for yours but I have one I do that goes to next item when they click the next button in my gallery. 

 

My gallery is tied to a SharePoint List which uses an auto ID by default.

 

Screen OnVisible = Set(varSelected, 1)

Next button OnSelect= Set(varSelected, ThisItem.ID + 1)

                                  Or = Set(varSelected, varSelected+1) -- If you want them to not have the option to go out of order.

 

Then for what I want to show it has =If(varSelected=ThisItem.ID, true, false)

samhegartyunsw1
Level: Powered On

Re: Navigate to next filtered gallery item

Thanks for the suggestion @rebeccas. In my case, because I'm filtering a collection which means I can't utilise an auto numbering system.

 

I'm really surprised PowerApps hasn't built nextItem and previousItem commands that let you do this as it's a common thing to do.

Super User
Super User

Re: Navigate to next filtered gallery item

If your using a collection instead of a data source you should (in theory...I haven't done this yet) be able to just add a column into your collection and create a auto number in that column. 

 

I usually don't work with collections that aren't tied to a data source but something like this should work for doing the auto number:

 

https://powerusers.microsoft.com/t5/General-Discussion/AutoNumber/td-p/184207

 

Good luck!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 218 members 5,044 guests
Please welcome our newest community members: