cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mugesh
Microsoft
Microsoft

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

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

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

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

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,118)