cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Patron
Post Patron

How can I set the Select value of a Gallery to the Nth item?

I want to set a default item from a Gallery as Selected when the screen loads, but not to activate the OnSelect. Is this what the Default Property of a Gallery is for?

How could I make it treat i.e: Row 2 as the Selected row?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: How can I set the Select value of a Gallery to the Nth item?

@stapes 

Yes, that's exactly what Default is for.  I believe you could select row 2 by using this code in the Default property.

 

LastN(FirstN(Gallery1.AllItems,2),1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: How can I set the Select value of a Gallery to the Nth item?

@stapes 

Yes, that's exactly what Default is for.  I believe you could select row 2 by using this code in the Default property.

 

LastN(FirstN(Gallery1.AllItems,2),1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Super User
Super User

Re: How can I set the Select value of a Gallery to the Nth item?

To add to that, if you want to make it apparent to the user which gallery item is selected by default, you can set the TemplateFill property of the gallery to:
If(ThisItem.IsSelected, Blue, White)

Blue and White are just for examples. Replace them with the fill colors you want.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,718)