cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

Possible to refer to 'next item' and 'previous item' as well as 'ThisItem'?

I have a set of data that may contain repeats, and I'd like to conditionally colour the first occurence of any repeats.

 

For example if my data was 'a, b, b, b, c, d' I would want the first 'b' to be blue.

 

Back in my InfoPath days I would have compared the current item to the next and preceding items to see if they were the same. I can't see a way to compare 'ThisItem' to the next or previous.

 

Or is there a better way of doing this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Thanks @Anonymous and @Drrickryp, I actually have a solution for this, but it may not be obvious how it relates to the odd way in which I described my problem!

 

Basically the solution was to use GroupBy.

 

What I was actually trying to do was show a list of events, but where the events were on the same date I only wanted to show the date on the first event.

 

So I created a gallery and set its items to GroupBy on a date column in my data. This kind of gives you two collections, one inside the other. The gallery effectively has a record of all the unique dates, but within each item is a collection of the other items with the same date. You can then add a gallery inside the first gallery, pointed to this secondary data. Then in the top level gallery, you can add things which are effectively only showing against the first occurence - which is what I originally wanted to achieve.

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Hi @davidstone,

Please check out this thread.  I think it will help you solve your problem.

https://powerusers.microsoft.com/t5/Creating-Apps/Next-amp-Back-buttons-to-move-through-Gallery-Reco...

Thanks - that's a bit closer. The problem is, that solution has a starting position to work from. Since I'll be looking relative to the current item, I'd need to know where in the dataset the current row was.

 

Highlighted
Anonymous
Not applicable

Hi @davidstone thank you for posting this thread. 

 

@Drrickryp can you review the latest reply and advise on a possible solution?

 

@Anonymous

Highlighted

Thanks @Anonymous and @Drrickryp, I actually have a solution for this, but it may not be obvious how it relates to the odd way in which I described my problem!

 

Basically the solution was to use GroupBy.

 

What I was actually trying to do was show a list of events, but where the events were on the same date I only wanted to show the date on the first event.

 

So I created a gallery and set its items to GroupBy on a date column in my data. This kind of gives you two collections, one inside the other. The gallery effectively has a record of all the unique dates, but within each item is a collection of the other items with the same date. You can then add a gallery inside the first gallery, pointed to this secondary data. Then in the top level gallery, you can add things which are effectively only showing against the first occurence - which is what I originally wanted to achieve.

View solution in original post

Highlighted

It might make more sense with a visual.

 

In the screenshot you'll see the two dates on the left side, but three events. The dates are labels inside the top level gallery, bound to the grouped data. The events in white are in a separate gallery inside each item in the top level gallery.

 

eventsgrouping.png

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (2,412)