cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Livearus
Helper III
Helper III

How to get a gallery item/record displayed outside of the gallery.

Hi there,

 

How is it possible that a record (ThisItem) from a gallery is displayed outside of the gallery, depending on the loaded template in a label.

 

In my case, I want to display a date (comes from SharePoint) in the orange label (see screenshot). The date should always be displayed from the last data record (right, 3rd data record) from the gallery (ThisItem.'LISA-Stand').

 

However, if not all three data sets are loaded, but only two, the last data set should still be displayed, in this case the second. I think it's somehow possible with the "Last" function.

 

But I can't even get the date to be displayed outside of the gallery at all.

 

Can you help me with this?

1 ACCEPTED SOLUTION

Accepted Solutions
adedapo
Helper I
Helper I

Hi @Livearus 

 

You can use the Last function with the AllItems property of the gallery.

For example, to get the last color from a gallery of colors, I can write:

 

 

 

Last(galColorSet.AllItems).ColorText

 

 

 

 

So for your case, you can write

 

 

 

Last(yourGalleryName.AllItems).'LISA-Stand'

 

 

 

 

Alternatively, you can use the Last function data source of the gallery directly; just note that you would have to apply the same filters if any was applied in the gallery items property.

View solution in original post

3 REPLIES 3
Pstork1
Dual Super User
Dual Super User

There is no way to do that for multiple records in a gallery at the same time outside the gallery.  If you want to do if for all the records then add the control to the Gallery template and use thisItem.  If you want to do it for just one record then use GalleryName.Selected.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
adedapo
Helper I
Helper I

Hi @Livearus 

 

You can use the Last function with the AllItems property of the gallery.

For example, to get the last color from a gallery of colors, I can write:

 

 

 

Last(galColorSet.AllItems).ColorText

 

 

 

 

So for your case, you can write

 

 

 

Last(yourGalleryName.AllItems).'LISA-Stand'

 

 

 

 

Alternatively, you can use the Last function data source of the gallery directly; just note that you would have to apply the same filters if any was applied in the gallery items property.

@adedapo Many Thanks. This was exactly the solution that produced the desired result.

 

@Pstork1 

Thank you too for your approach.

 

Regards

Helpful resources

Announcements
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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

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