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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

13 REPLIES 13
RandyHayes
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

@RandyHayes 

 

On doing so I get the following error???

 

Kmayes_0-1602257997370.png

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,305)