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
Super User
Super User

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

11 REPLIES 11
biancadevera
Helper III
Helper III

StalinPonnusamy
Super User
Super User

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

AmDev
Super User
Super User

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
Super User
Super User

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
Super User
Super User

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (2,782)