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 / How to auto select fir...
Power Apps
Unanswered

How to auto select first item in a gallery after filtering with radio buttons?

(0) ShareShare
ReportReport
Posted on by 383

My app has a home screen, which contains a gallery and an edit form. When loading the app, the first item is selected, and the details of that item are shown in the form, as expected. I have radio buttons which allow me to filter the list by items opened this week, this month, and show all.

 

When I select one of these filtering options, the gallery is filtered as expected, but it does not auto select the first item, which results in the "Getting your data" message in the form screen. That goes away once you click on one of the items in the gallery. How can I fix this so that once I filter, it auto selects the first item visible in the gallery?

Categories:
I have the same question (0)
  • Matren Profile Picture
    454 Super User 2024 Season 1 on at

    Hi @TrayH,

     

    Try adding a select statement:

     

    Select(GalleryName,1,"name of your icon in gallery that you click to view a record")

     

    Best Wishes,

    Matren

    --------------------------------------------------------------------------------------------

    Find this post helpful, give it a Thumbs Up

    Solved your problem, click Accept as Solution so others can find it

  • TrayH Profile Picture
    383 on at

    Hi Matren, adding the select statement where? To the default property of the gallery?

  • Matren Profile Picture
    454 Super User 2024 Season 1 on at

    Hi @TrayH,

     

    Sure you can try that, and also try after where you placed the code to filter the items. It depends on the app behavior you are looking for (i.e. always default to the 1st item in the gallery when there is not a selection, or only default after the items are filtered.)

     

    Best Wishes,

    Matren

    --------------------------------------------------------------------------------------------

    Find this post helpful, give it a Thumbs Up

    Solved your problem, click Accept as Solution so others can find it

  • TrayH Profile Picture
    383 on at

    Unfortunately, that did not work. It's not that big of a deal, but it would be nice to figure this out.

  • Matren Profile Picture
    454 Super User 2024 Season 1 on at

    Hi @TrayH,

     

    No worries ... the select statement I provided is what is commonly used, and I have implemented in apps. The statement just needs to be added in the right spot. Can you share the code for your Gallery Items and Default Property?

     

    Thanks,
    Matren

     

    --------------------------------------------------------------------------------------------

    Find this post helpful, give it a Thumbs Up

    Solved your problem, click Accept as Solution so others can find it

  • TrayH Profile Picture
    383 on at

    Here is the Items property for the Gallery:

    Sort(
    Filter(SPDevModern_List_FailsPolicyReview,
     (IsBlank(rdoDateSelect_1.Selected.StartDate) || (Created >= rdoDateSelect_1.Selected.StartDate)) &&
     (IsBlank(rdoDateSelect_1.Selected.EndDate) || (Created <= rdoDateSelect_1.Selected.EndDate))
    )
    ,'Issue #'
    ,Descending
    )

    The default property for the Gallery is currently blank.

  • Matren Profile Picture
    454 Super User 2024 Season 1 on at

    @TrayH,

     

    Great! Can you also share the following:

     

    1. OnSelect property of your radio buttons

    2. On Select property for your right arrow (the one you click to view a record)

    3. Name of your right arrow icon (the one you click to view a record)

     

    Thanks,
    Matren

    --------------------------------------------------------------------------------------------

    Find this post helpful, give it a Thumbs Up

    Solved your problem, click Accept as Solution so others can find it

  • Matren Profile Picture
    454 Super User 2024 Season 1 on at

    Hi @TrayH,

     

    Just need to add after code in the right property.

     

    ; Select(GalleryName,1,"name of your icon in gallery that you click to view a record")

     

    You could add the code as the last part to the last part for your OnSuccess property for the form (i.e. after a form has been submitted).

     

    Also, if you provide the other information (items 1-3) above, it would help us find other locations.

     

    Best Wishes,
    Matren

    --------------------------------------------------------------------------------------------

    Find this post helpful, give it a Thumbs Up

    Solved your problem, click Accept as Solution so others can find it

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