Hi there,
I have a screen in my canvas app where I have a toggle to select-all checkboxes on that screen.
OnVisible of the page, I have created the collection of allboxes using Collect(allboxes, 'checkbox1'.Value, 'checkbox2'.Value); (I will add in the other 5 checkboxes once I've got this working).
What I want is, when the user turns the toggle to Yes, it ticks all the checkboxes which are in that collection.
Please can someone help me out here?
Thanks,
K.
Solved! Go to Solution.
Hi @Kosenurm ,
I believe your checkboxes are independent. If I got you correctly, your set is something like the below screenshot.
on right side, I am trying to show the values reflected in coll_result based on my selection.
Give a like and accept this as the solution if I answered you . 🙂
In the Onselect Property of the toggle you can apply ForAll for all the items in the collection and change their values
hi, create the collection in the following way
Collect(Col_Toggles,{value:Toggle1} etc.)
then change the toggle defaults to
Self in Col_Toggles && var_toggle
OnSelect of button change to all toggles
Set(var_toggle, !var_toggle)
Thanks, but this is for Check Boxes...
Which value of the checkbox control should I add to the collection?
take the default property of the checkbox
Hi @Kosenurm ,
I have a similar setup, but in a Lil different format as shown below screenshot. By selecting the checkbox on top, it selects all and, on deselect, it marks all as cleared.
Let's say your source is source1.
Step -1 :-
> On page load, ClearCollect(coll_GalDisplay,AddColumns(Source1,"ischecked",false)) this will create a collection "coll_GalDisplay" which we are going to use in gallery to display.
The new column added, ischecked will contain the value of checked Items.
> 2nd create a toggle/ separate check box (Marked in red in screen shot)
Property - OnCheck- Updateif(coll_GalDisplay,true,{ischecked: true})
Property - OnUncheck - Updateif(coll_GalDisplay,true,{ischecked: false})
For individual check boxes to select, or unselect,
Property - OnCheck- Patch(coll_GalDisplay,,ThisItem,{ischecked:true})
Property - OnUncheck - Patch(coll_GalDisplay,,ThisItem,{ischecked:true})
Please give a like and accept this as the solution if this will help in your requirement.
Thanks. I think you are on the right path.
What I need is...
When the user selects one of the checkboxes, this adds to a collection. If they add more than one, they are all added. If they uncheck one, or uncheck more than one, the collection is updated to their new check statuses.
The toggle needs to set ALL checkboxes to checked OnCheck, and decheck ALL checkboxes OnUncheck...
Sorry, I am really struggling.
Thanks
K.
Could you please try On check property for an individual item,
Property - OnCheck- Patch(coll_GalDisplay,,ThisItem,{ischecked:true});
Collect(coll_result, ThisItem);
Property - OnUncheck - Patch(coll_GalDisplay,,ThisItem,{ischecked:true});
Remove(coll_result, ThisItem);
At the end, your collection "coll_result" will have the final list of items that you have selected for your next action.
I am not using a gallery, so ThisItem is not working.
K.
If you are trying to collect it from a collection, I will suggest to add a button called "load".
So once you are clear with your selection, Click the load button to collect the selected values.
Load Button- Property "On Select"- ClearCollect(Coll_result,Filter(allboxes, ischeked = true)).
It will load all the items from allboxes collection to result collection where the condition satisfies.
User | Count |
---|---|
256 | |
111 | |
95 | |
48 | |
41 |