cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
biancadevera
Helper III
Helper III

Yes/No checkbox

I have 5 columns in SP list set to Yes/No type. In my app, whenever I check the checkbox (separate data cards), I want to show it as Yes in my data source. No if unchecked. How can I do this?

1 ACCEPTED SOLUTION

Accepted Solutions
StalinPonnusamy
Community Champion
Community Champion

Hi @biancadevera 

 

I assume you are looking to update Datasource right away. It means when you check and UnCheck the checkbox.

 

Set OnCheck property of Checkbox to

Patch(SPList,ThisItem,{ColumnName:true})

 

Set OnUncheck property of Checkbox to

Patch(SPList,ThisItem,{ColumnName:false})

 

Make sure to set the Default property of Checkbox control to

ThisItem.ColumnName

 

And you may need to Remove the Update property of the DataCard since we saved the data already.

Note: It will be lots of calls Datasource for each check and UnCheck.

 

If you are not looking to Save immediately then  Set the Update property of DataCard to 

CheckBoxName.Value


Thanks,
Stalin - Learn To Illuminate

View solution in original post

10 REPLIES 10
biancadevera
Helper III
Helper III

StalinPonnusamy
Community Champion
Community Champion

Hi @biancadevera 

 

I assume you are looking to update Datasource right away. It means when you check and UnCheck the checkbox.

 

Set OnCheck property of Checkbox to

Patch(SPList,ThisItem,{ColumnName:true})

 

Set OnUncheck property of Checkbox to

Patch(SPList,ThisItem,{ColumnName:false})

 

Make sure to set the Default property of Checkbox control to

ThisItem.ColumnName

 

And you may need to Remove the Update property of the DataCard since we saved the data already.

Note: It will be lots of calls Datasource for each check and UnCheck.

 

If you are not looking to Save immediately then  Set the Update property of DataCard to 

CheckBoxName.Value


Thanks,
Stalin - Learn To Illuminate

View solution in original post

AmDev
Solution Sage
Solution Sage

Hi @biancadevera 

 

Once you have brought in your checkboxes to each data card, set their default to 'Parent.default', make sure the default in the Datacard is set to 'ThisItem.YourYNColumnName' and also change the 'Update' property of the datacard to 'Checkbox#.Value'.

 

If you want to show specific text for true vs false selection, you can set the 'Text' property of each checkbox to 'If(Self.Value, "true text", "false text")'.

 

Hope this helps - Good luck!

AmDev
Solution Sage
Solution Sage

Just to follow up, I'm taking from your original message you are using the Yes/No Type which is a boolean, so in your backend data this wont show as "yes" or "no", it will show as a tick, when yes and blank space when no as follows:

 

AmDev_0-1637418963383.png

 

Hi @StalinPonnusamy 

 

It worked but how can I show the value on Edit form? After I saved the entry and edit it, it shows blank. I've already set the Update property to 

 

CheckBoxName.Value

Yes it's boolean and my backend shows exactly like this.

StalinPonnusamy
Community Champion
Community Champion

Hi @biancadevera 

 

Set the default property of the checkbox to

 

ThisItem.ColumnName

StalinPonnusamy_1-1637422417380.png

 

 

Set the DataCard to

ColumnName

StalinPonnusamy_0-1637422400033.png

 

 

 

Yep. That worked! Thank you so much @StalinPonnusamy 

biancadevera
Helper III
Helper III

Hi @StalinPonnusamy just a follow up question. How can I reset the checkboxes on New form? It looks like it saves the last entry when creating new one. Please advise. Thanks!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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