web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Auto select gallery it...
Power Apps
Answered

Auto select gallery item while still able to switch items

(0) ShareShare
ReportReport
Posted on by

Hello guys, 

 

I'm trying to autoselect the first item in a gallery when a user lands on the screen. The gallery consists of dates of a specific training and is derived from a sharepoint list. I'm using the formula First(Self.AllItems) on Default property now. However, this doesn't allow users to select other items than the first one. Does anyone know how I can auto select the first gallery item while it's still possible for users to select another one? 

MathijsM_0-1658914025602.png

Would really appreciate it, thank you. 

Categories:
I have the same question (0)
  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi @Anonymous ,

    I'm not sure why you can't select other items, so there may be something else preventing you - however when using a Default: record for a gallery to 'auto select' when it is reset, the best thing to do is ensure you're selecting a record from the exact same data set that is being configured in the Items: property of the Gallery.

    So, if your source is "mySource" and your Items: property is

    mySource
    
    or 
    
    Filter(mySource, condition)

    then your Default: would be

    First(mySource)
    
    or 
    
    First(Filter(mySource, condition))

    respectively - so I would first change from "First(Self.AllItems)" to whatever fits above and see if you still get the same behaviour before troubleshooting further.

    Kind regards,

    RT 

     

  • Community Power Platform Member Profile Picture
    on at

    Hi @RusselThomas !

     

    Thank you so much for your quick and effective solution! Your second option with the condition involved worked for me. Your explanation helps me to do it myself the next time!😀

     

    Have a nice day and thanks again

  • Ed_Pham Profile Picture
    12 on at

    This also has worked for me.  Thanks you very much Russell Thomas.

  • MB-08011503-0 Profile Picture
    4 on at
    @RusselThomas Interestingly, the second approach also worked for me, when using First(x), where x is the exact expression that I use in the galleries items property. However, I would expect First(Self.AllItems) to also work, since x and Self.AllItems shoud be the same, but it is not working and the first item is being selected again, even when I select another item. Do you have an explanation for this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard