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
Resolver I
Resolver 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
Resolver I
Resolver 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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,808)