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

Gallery Default property type/format?

Hi there,

I'm working on an on call roster app. Users will see who is rostered on call this week, as well as previous and future entries in the roster.

I want to implement this as a gallery. I want to use the Default property of the gallery to set the displayed gallery item. This is so that the initial scroll position of the gallery will be at today's on call duty, and the user can scroll up or down to see adjacent entries. The problem I've encountered is, I can't figure out how to set the value of the Default property.

The Gallery control properties documentation doesn't say which which type it uses, nor does it give an example situation using this property.

In fact, I wouldn't have even known this was the correct property to use, had it not been for this forum post - https://powerusers.microsoft.com/t5/PowerApps-Forum/Gallery-Scroll-to-a-Default-Item/m-p/4558/highli... . However, the method suggested in the post leaves the type and/or format of a Default property value opaque to the user.

How can I set the value of a gallery's Default property?
20 REPLIES 20
bdc604
Advocate III
Advocate III

Even when clearing the collection, I cannot get Powerapps to select the first Gallery item in a custom view form by default when closing the view form and selecting a different list item. It fires once, the very first time, then nothing when I go to other list items.

Gallery1.Default = First(Collection1)

I tried Screen1.OnHidden = Clear(Collection1) but that didn’t help.

Any suggestions? Perhaps in SP vs stand-alone apps the custom form is never truly hidden, just collapsed out of view, and OnHidden doesn’t get triggered properly?

Whats the point of a Default property if you need to wire up a button to set it? In tha case I would just manually select the first item...

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (62,324)