cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to check for First or Last items of a Gallery

Hi all,

 

Currently building an app where users can request and approve company travel items.

 

I've built the UI of the "overview" screen as a timeline of travel events (flights, etc). Wondering whether anyone out there might know how to detect whether a given item is the First or Last one in a gallery? Would be useful in showing or hiding aspects of the UI to dictate whether the timeline ends or starts from a particular item.

Cheers

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Meneghino
Level 10

Re: How to check for First or Last items of a Gallery

Hi @Anonymous

 

You can use the First and Last functions.  If outside the gallery then you can use the AllItems property of the gallery.

For example:  If(Gallery1.Selected = First(Gallery1.AllItems), XXX, YYY)

 

If inside the gallery (i.e. for a control in the gallery template) then I think that you cannot use AllItems, so just use First or Last with the same expression as the Items property of your gallery.

 

Please provide specific needs (incl. Items property) if the above is not clear enough.

View solution in original post

2 REPLIES 2
Highlighted
Meneghino
Level 10

Re: How to check for First or Last items of a Gallery

Hi @Anonymous

 

You can use the First and Last functions.  If outside the gallery then you can use the AllItems property of the gallery.

For example:  If(Gallery1.Selected = First(Gallery1.AllItems), XXX, YYY)

 

If inside the gallery (i.e. for a control in the gallery template) then I think that you cannot use AllItems, so just use First or Last with the same expression as the Items property of your gallery.

 

Please provide specific needs (incl. Items property) if the above is not clear enough.

View solution in original post

Anonymous
Not applicable

Re: How to check for First or Last items of a Gallery

Worked brilliantly. Thanks @Meneghino ! 🙂

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,001)