I have a multi selection dropdown (Location) connected to Sharepoint with 3 choices ("North America","Europe","Asia-Pacific"). In my powerapps form, i want to have a 'Select All' checkbox which if checked, it will select all 3 values in the dropdown. How could i do this? I have run out of options. Thanks
Solved! Go to Solution.
Hi @Anonymous ,
Is the Location field a Chioce type column in your SP List?
Do you enable "Allow Multiple selections" option for the Location field in your SP list?
Further, do you want to select all option values within the Location ComboBox when you check the checkbox?
I assume that the Location field is Choice type column in your SP List, and you have enabled "Allow Multiple selections" option for it. I have made a test on my side, please take a try with the following workaround:
Add a Checkbox within the Location Data card, set the OnSelect property of the "Checkbox" control to following:
If( Checkbox1.Value, Set(SelectAll, true), Set(SelectAll, false) )
Set the Items property of the Location ComboBox to following:
Choices('YourSPList'.Location)
Set the DefaultSelectedItems property of the Location ComboBox to following:
If( SelectAll, Table( { Value: "North America" }, { Value: "Europe" }, { Value: "Asia-Pacific" } ), Parent.Default )
Please check the GIF screenshot for more details:
Best regards,
So here's the process that works for me.
1) set a variable called AllItems to True in the ONChecked property of the checkbox and False in the OnUnchecked.
2) set the defaultselectedItems property of the ComboBox to
If(allitems,collection,Table())
This works when the datasource is a collection, but not when using a regular datasource. What its really looking for in the defaultselectedItems is a comma delimited list of the item names.
Hi @Anonymous ,
Is the Location field a Chioce type column in your SP List?
Do you enable "Allow Multiple selections" option for the Location field in your SP list?
Further, do you want to select all option values within the Location ComboBox when you check the checkbox?
I assume that the Location field is Choice type column in your SP List, and you have enabled "Allow Multiple selections" option for it. I have made a test on my side, please take a try with the following workaround:
Add a Checkbox within the Location Data card, set the OnSelect property of the "Checkbox" control to following:
If( Checkbox1.Value, Set(SelectAll, true), Set(SelectAll, false) )
Set the Items property of the Location ComboBox to following:
Choices('YourSPList'.Location)
Set the DefaultSelectedItems property of the Location ComboBox to following:
If( SelectAll, Table( { Value: "North America" }, { Value: "Europe" }, { Value: "Asia-Pacific" } ), Parent.Default )
Please check the GIF screenshot for more details:
Best regards,
I agree with all @v-xida-msft comments.
But I would suggest one change. Rather than using an IF statement in the OnSelect just add the True and False settings for the variables to the OnCheck and OnUncheck methods respectively.. That way you don't need an IF
Hi @Anonymous how are you progressing with this? Were the above replies helpful?
@Anonymous
wow thank you guys!! Last question, how do i clear the variable? I like clearing them onhidden
You can set a Variable to Blank, which will clear the value, but there is no way I know of to delete the variable entirely once you set it.
User | Count |
---|---|
256 | |
254 | |
82 | |
41 | |
30 |
User | Count |
---|---|
319 | |
269 | |
121 | |
68 | |
50 |