cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kmayes
Post Prodigy
Post Prodigy

Patch Checkbox value

I've built a new SP list and I'm customising the form using PA. The reason I'm doing this is the list that is built is purely being maintained by automation. However that said the only manual manipulation that is required is selecting the months. On selection of each checkbox I want the number "1" passed back to the relevant column in SP.

 

I used Patch('SP List',Defaults('SPList,),{AprYR1:"1"}) on 'On check' however this creates a new item rather than patching the record selected through the SP list?

Then on the flip side if someone is to uncheck the checkbox I want the value to be removed if there was one.

 

Is anyone able to offer any assistance on how to fix this issue?

 

Kmayes_1-1602167493895.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

@Kmayes 

Great, then set your formula to the following:

UpdateIf('SP List', ID=SharePointIntegration.Selected.ID, {AprYR1:If(Self.Value, "1", "")}) 
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

13 REPLIES 13
RandyHayes
Super User
Super User

@Kmayes 

What is the Item property of your Form?

Yes, if you use Defaults it will always create a new record.  You need to refer to your record to patch/update it.

Once you identify the Item property record you can utilize this formula:

Patch('SP List', formRecord, {AprYR1:If(Self.Value, "1", "")}) 

Also available would be the UpdateIf formula:

UpdateIf('SP List', ID=formRecord.ID, {AprYR1:If(Self.Value, "1", "")}) 

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Could you point me in the right direction of the item property? So that I can find it 

@RandyHayes 

 

Im not sure what element you are referring to could you provide further info?

Kmayes_0-1602240303506.png

 

@Kmayes 

This should be that same record that your form is using in its Item property. 

Take a look at that property and see what it is...that is the record.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

I have tried the properties from those where the ID is the Title but im still pretty lost here? Am I looking in the wrong place?

Kmayes_0-1602255111285.pngKmayes_1-1602255131447.png

 

@Kmayes 

Please look at the Item property of your SharePointForm1 edit form.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

When looking at the item property its shows the below is this correct?

 

If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@'Cost Profile']),SharePointIntegration.Selected)

@Kmayes 

Great, then set your formula to the following:

UpdateIf('SP List', ID=SharePointIntegration.Selected.ID, {AprYR1:If(Self.Value, "1", "")}) 
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

On doing so I get the following error???

 

Kmayes_0-1602257997370.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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