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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Selection Change in So...
Power Pages
Answered

Selection Change in Sorted/Filtered Gallery to next item with Multi Select Check Box

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

We have a collection having data. We are filtering using some conditions and showing it in gallery with Multi select Check box option. Also we have added 5 flag user actions. What we need here is whenever on successful user actions, we need to select the default next row item in the gallery.

Also for eg, if the user multi select 5 rows among 10 sorted items in the gallery. It needs to default select the next (6 th) row item in the gallery.

Please help me out in resolving this issue.

Thanks in advance.

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Mugesh :

    Could you tell me:

    • What are " flag user actions"?
    • What does successful user actions mean?
    • What is the gallery's items property?What is the sort rules?
    • What is the data structure of the data source?

    I assume you want to implement such a function:

    After the user selects a check box and changes its value to true, the gallery selects the next item by default.

    I've made a test for your reference:

    My data source(testcollection):

     

    ClearCollect(testcollection,{title:"test1",check: false ,ID:1},{title:"test2",check: false ,ID:2},{title:"test3",check: false ,ID:3},{title:"test4",check: false ,ID:4},{title:"test5",check: false ,ID:5},{title:"test6",check: false ,ID:6},{title:"test7",check: false ,ID:7},{title:"test8",check: false ,ID:8},{title:"test9",check: false ,ID:9})

     

    1\Add a gallery(Gallery2):

    Items:

     

    Sort(testcollection,ID,Ascending) /*sort by ID*/

     

    Default:

     

    First(test) /*test is my custom variable,I will define it later */

     

    2\Add a Check Box control into this gallery:

    Default:

     

    ThisItem.check

     

    OnCheck:

     

    Patch(
     testcollection,
     ThisItem,
     {check: true}
    ); /*Write the checkbox result to the data source*/
    ClearCollect(
     test,
     LookUp(
     testcollection,
     ID = ThisItem.ID + 1
     )
    ); /*test is a custom collection I used to store the default selection of the gallery */
    Reset(Checkbox1); /*Reset the control so that the default properties of the control take effect*/
    Reset(Gallery2)

     

    OnUncheck:

     

    Patch(testcollection,ThisItem,{check:false});Reset(Checkbox1)

     

    3\Add a label control(Used to display the currently selected record of the gallery)

    Text:

     

    Gallery2.Selected.title

     

    1.gif

     After I changed the value of the checkbox of the 1/2/3/4/5 record to true, the gallery selected the 6th record by default.

    Best Regards,

    Bof

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 41

#2
sannavajjala87 Profile Picture

sannavajjala87 30 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 20 Super User 2026 Season 2

Last 30 days Overall leaderboard