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
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...

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 213 members 6,440 guests
Please welcome our newest community members: