cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Checkbox can remove his value on a multichoice column in sharepoint list ?

Hi,

 

I have some understanding with checkboxes on Powerapps. I have on specific column a multi choice option : for example, I have some checkboxes where each of them has a specific value and different values : a, b, c and d.

 

This is my onCheck, OnUncheck, OnSelect and Default on one of them : 

 

- OnCheck

ClearCollect(
	Collection1;
		If(Checkbox1.Value;"a");
		If(Checkbox2.Value;"b");
		If(Checkbox3.Value;"c");
		If(Checkbox4.Value;"d")
)

 

OnUncheck

 

ClearCollect(
	Collection1;Filter(
		Collection1;
		!IsBlank(Value)
	)
);;

 

 

- OnSelect

 

Collect(Collection1; 'Données');;

 

 

- Default

 

If(
	{
		'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
		Id: 1;
		Value: "a"
	} in Matériel_DataCard1.Default;
	true;
	false

 

When I check for the first time the checkbox this work fine, and I see my value inserted on my multi choice column. However, when I unchecked one checkbox (for example I have unchecked the checkbox1 and checked the checkbox2), on my multi choice the value of the first checkbox wasn't removed and the value of the second was added. 

 

How can I remove the value of my checkboxes when I unchecked them ?

 

Thanks for your help.

 

 

 

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Checkbox can remove his value on a multichoice column in sharepoint list ?

Hi @Nosmoz ,

Do you want to use check box to update a multiple choice column?

I've tested your formula, this will not create a collection with the data that you select.

I've made a similar test for your reference:

1)insert 4 check boxes

2)Set the check boxes's OnCheck:

ClearCollect(Collection1,
{Value:"a",data:Checkbox1.Value},
{Value:"b",data:Checkbox2.Value},
{Value:"c",data:Checkbox3.Value},
{Value:"d",data:Checkbox4.Value})

In my way, you do not need to set the OnUnCheck property.

Here's the collection1 that I create:     (I choose a,c,d as an example)8192.PNG

 

3)Set the submit button's OnSelect:

Patch(listname,Defaults(listname),{fieldname:Filter(Collection1,data=true)})

Please consider the data's format that the multiple choice column needs.

The data format should be like this:8193.PNG

So using filter function to filter the checkbox value equal to true will lead to this result.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: Checkbox can remove his value on a multichoice column in sharepoint list ?

Hi @v-yutliu-msft thanks for your help.

 

I was testing each of your points, but when I write the function 

Patch(listname,Defaults(listname),{fieldname:Filter(Collection1,data=true)})

 I see an error : 'the column fieldname doesn't exist'. I tested with the column name 'Value', but i have the same error.

 

Regards, 

 

Nosmoz.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,436)