cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

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
Highlighted
Community Support
Community Support

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

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
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (5,155)