web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Update using Checkbox
Power Apps
Unanswered

Update using Checkbox

(0) ShareShare
ReportReport
Posted on by 103

Hi Experts,

I am new to PowerApps, I have connected sql server with PowerApps.

I have one field called approve which is int datatype, I need to update the values for this field using checkbox.

For suppose if checkbox is checked then the approve value will become 1, if the checkbox is not checked then the approve value will be 0. 

Please suggest me the correct path.

Can anyone help me to achieve this?

Thanks,

with regards, 

user237, 

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    OnSelect of a Button try this code

    Patch(Datasource,Defaults(Datasource),

    {Approve:If(Checkbox1.Value=true,1,0)})

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Srihari.molaka Profile Picture
    103 on at

    Hi @eka24 ,

    Thanks for your reply,

    I have tried this formula at onSelect property of checkbox card, but it is throwing error like invalid arguments for patch.

    Instead of colon it is expecting closed bracket.

    with regards,

    User237,

  • eka24 Profile Picture
    20,925 on at

    Please give a screen shot

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Srihari.molaka Profile Picture
    103 on at

    Hi @eka24 ,

    Thanks for your reply,

    below is the screenshot of my edit form

    these two cards related to one field called approvedthese two cards related to one field called approved

    with regards,

    user237.

  • Srihari.molaka Profile Picture
    103 on at

    Hi all,

    I have also seen the below post which is near to my requirement but did not understand well.

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Using-Checkbox-to-Update-txt-field/m-p/626615/highlight/false#M198547

  • eka24 Profile Picture
    20,925 on at

    Please show a screen shot of the Patch formula

    You also mentioned a checkbox, is it same as shown in the picture

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Srihari.molaka Profile Picture
    103 on at

    Hi @eka24 ,

    Thanks for your reply,

    Patch(Datasource,Defaults(Datasource), ThisItem.APPROVED : if(Checkbox3.Value = true, 1, 0))

    yes, I mentioned the checkbox in the picture named as checkbox3.

    with regards,

    user237.

  • Srihari.molaka Profile Picture
    103 on at

    Hi @eka24 ,

    Thanks for your help,

    I have created a new button called save, for that button i have written the patch formula which is provided by you,

    It is working now.

    But the save button throwing error like Partition field required in the patch formula, can you give any solution for this?

    with regards,

    user237.

  • eka24 Profile Picture
    20,925 on at

    It means that you have a column called Partition that you have made it a required field.

     

    So either you remove the required in the Table and make it not required.

    Or A

    that to the Patch formula Like

    Patch(Datasource,Defaults(Datasource), {APPROVED : if(Checkbox3.Value = true, 1, 0),

    Partition: Datacaradvalue4.Texy})

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • Srihari.molaka Profile Picture
    103 on at

    Hi @eka24 ,

    Thanks for your reply,

    It is asking all the fields in the table to add.

    with regards,

    user237

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard