cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nati
Level: Power Up

Patching Sharepoint list from checkbox

Hi,

I'm quite new in PowerApps and I'm trying to create a new a new one. I created a gallery based on my Sharepoint list. i would like to add a checkbox in gallery. Once a checkbox is "checked" I would like to update specific column in my Sharepoint list referenced to other data in gallery. Is such functionality possible to create in PowerApps?

 

For this exercise lets assume that I have below columns that are presented in my gallery/sharepointlist:

Column1:EmployeeName

Column2: Month

Column3: Training

Column4: Attended (I would like to use Checkbox in gallery showing if employee attended a specific training) If this checkbox is "Checked" in the gallery  I would like to update list on sharepoint automatically with Value "Yes", If it is "unchecked" with "No".

 I tried to use Patch function but I got stuck! I would really appreciate your help.

 

Regards,
Nati 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Sienna
Level 10

Re: Patching Sharepoint list from checkbox

Right... Set the default of your checkbox to 

If(ThisItem.ColumnNameLinkedToCeckBox="Yes",true,false)

View solution in original post

MarcBailey
Level 8

Re: Patching Sharepoint list from checkbox

Awesome - that works...

 

Could you copy and paste the code as follows into my Post so I can mark it a Solved by you.

 

My Post link:  Checkbox Value needs to Patch or UpdateIf to SharePoint List

 

OnCheck:      Patch(YorDatabaseName, GalleryName.Selected, {Attendent: “Yes”})

OnUncheck:  Patch(YorDatabaseName, GalleryName.Selected, {Attendent: “No”})

Default:         If(ThisItem.ColumnNameLinkedToCeckBox="Yes",true,false)

View solution in original post

11 REPLIES 11
MarcBailey
Level 8

Re: Patching Sharepoint list from checkbox

Hi Nati,

 

I just posted a similar Checkbox related scenario - shortly before you.  I have spent the past 2 days trying various approaches and code with no success.  In addition, there is minimal documentation related to the Checkbox function.

 

Hopefully, someone will provide one of our post a solution.

 

Marc...

Nati
Level: Power Up

Re: Patching Sharepoint list from checkbox

Hi Marc,

 

Good to know that we have simillar problems.

I tried to use Patch function and I thought it works as data was updated to SharePoint list but when I strated moving into other lines in gallery everything got unsellected. I had to mixed something with"OnSelect' "OnCheck" and "OnUncheck" fields

As you mentioned lets hope somebody will provide solution! It would be very useful. I have spent the last two days or event more trying different solutions as well.

 

Nati

Sienna
Level 10

Re: Patching Sharepoint list from checkbox

@Nati
Put your patch into OnCheck property of checkbox. Like this
Patch(YorDatabaseName, GalleryName.Selected, {Attendent: “Yes”})

You can also put in OnUncheck property of your checkbox exactly the same but change the yes to no
Nati
Level: Power Up

Re: Patching Sharepoint list from checkbox

@Sienna

Thank you for information. I tried to use that as well. But something strange happens when I'm unchecking checkbox previously checked. All checkboxes are unchecked automatically, like something is not linked in the gallery and I have to start over.

MarcBailey
Level 8

Re: Patching Sharepoint list from checkbox

Hi Sienna,

 

This is Marc - I have a similar scenario and have tried your recommended code and it does allow the value to update to my SharePoint list.

 

The problem is that it resets all of the checkboxes after the Patch. I need to retain the value of the Checkbox until it is clicked again to check or uncheck in the Checkbox.

 

Any suggestions.  Thanks, Marc...

Sienna
Level 10

Re: Patching Sharepoint list from checkbox

Ok hold on.. let me try it.. ill be back with solution
Sienna
Level 10

Re: Patching Sharepoint list from checkbox

@MarcBailey @Nati

It all works with me... The only problem what comes to my mind is incorectly set default property of checkbox. So how do you set default property of  the checkbox?

MarcBailey
Level 8

Re: Patching Sharepoint list from checkbox

@Sienna

 

My Default for the Checkbox is set to false.  What is your Default set to that allows it to retain the status of the Checkbox after clicking.

 

Thanks for your work on this, Marc...

Highlighted
Sienna
Level 10

Re: Patching Sharepoint list from checkbox

Right... Set the default of your checkbox to 

If(ThisItem.ColumnNameLinkedToCeckBox="Yes",true,false)

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,109)