cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Aurora
Helper V
Helper V

Help Cycling Through Gallery or SharePoint Items

Hi All, 

 

My company has an app that tracks quality issues with parts we manufacture. When a quality issue is frequent enough, we create a "Quality Alert" that is displayed in the workshop for builder to see. Where I need help is:

 

We would like to have our quality app "Cycle Through" all of the quality alerts. Currently, I have a gallery that shows data for each quality alert and am wondering if there is a way to set a timer and have the gallery change the "selected Item" after a certain duration. We often include images with the quality alerts, So I have to be able to provide a section with a large enough image for our floor workers to see. I have a working image viewing component, So I know if I'm able to change the selected item, I can display that Items image. I'll include an image of what I have so far, though its basic so far. 

 

Any suggestions on where to start or what to do would be greatly appreciated. 

 

Aurora_0-1653497152302.png

If I can have the app automatically change the selected gallery item, this layout should work.

 

1 ACCEPTED SOLUTION

Accepted Solutions
BCBuizer
Super User
Super User

Hi @Aurora ,

 

The recently introduced Index() function should be of use here:

 

https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-first-last

 

If you initialize a variable (varIndex) to 1 and then use buttons to increase (display next item) or decrease (display previous item).

 

For this you need to set the Item property of your form to:

Index(YourDataSource, varIndex)

 

The Next button should have the following OnSelect property:

Set(varIndex, If(varIndex+1 > CountRows(YourDataSource),1,varIndex+1)

 

Likewise the Previous button should have the following Onselect property:

Set(varIndex, If(varIndex-1<1,CountRows(YourDataSource),varIndex-1)

 

View solution in original post

3 REPLIES 3
jcfDaniel
Skilled Sharer
Skilled Sharer

Hi,

 

Reading your question the teleprompter came to time. See if you can adapt it to your need.

 

Power Teleprompter v2 - Power Platform Community (microsoft.com)

 

Should it work, here's the author's linkedin: Hardit Bhatia | LinkedIn

 

Regards.

BCBuizer
Super User
Super User

Hi @Aurora ,

 

The recently introduced Index() function should be of use here:

 

https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-first-last

 

If you initialize a variable (varIndex) to 1 and then use buttons to increase (display next item) or decrease (display previous item).

 

For this you need to set the Item property of your form to:

Index(YourDataSource, varIndex)

 

The Next button should have the following OnSelect property:

Set(varIndex, If(varIndex+1 > CountRows(YourDataSource),1,varIndex+1)

 

Likewise the Previous button should have the following Onselect property:

Set(varIndex, If(varIndex-1<1,CountRows(YourDataSource),varIndex-1)

 

Hi @BCBuizer,

 

After some initial testing, I think this will work. Thank you for the help!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,351)