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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to change the valu...
Power Apps
Unanswered

How to change the value of field using a checkbox?

(0) ShareShare
ReportReport
Posted on by 106

Good day! I hope you can all help me with my dilemma. I created a Canvas app that is connected to sharepoint list as its data source the purpose of this app is to update a single field "keep/remove" using a checkbox keep if the checkbox is check and remove if the checkbox is uncheck. I used an empty gallery and textboxes to show the data and make it look like a table the update is working. Now here's the problem is there way to change the value of "keep/remove" based on the checkbox note this is only for viewing purpose the real of the field 'keep/remove" will be updated once the updated is clicked. I tried putting an If statement on the oncheck properties of the checkbox but it doesn't work. Thank you

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

    You can use Patch to update the column. Follow this tutorial:

    https://youtu.be/gKWf_XQyIH0

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

    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.

  • jan_mac Profile Picture
    106 on at

    Thank you for your post the video did resolve my dilemma however I have a new dilemma now. I wanted the check boxes to remain check/uncheck so I put this code "If(ThisItem.'Keep/ Remove' = "Keep", true, false) " on the default of the check but I already have an existing code on the default "Checkbox3.Value" as I also need a check all button. Is there way to keep both codes? Or alternative way to achieve a check all box.

  • eka24 Profile Picture
    20,923 on at

    Can you explain further the existing code of Checkbox3.Value and is this another checkbox? 

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

    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.

  • jan_mac Profile Picture
    106 on at

    Sorry I didn't see the reply. I have two check boxes: Checkbox which is inside the gallery and Checkbox3 which is outside the gallery it acts as a check all for all checkboxes inside the gallery.  On the default of Checkbox is the code "Checkbox3.Value" which means if Checkbox3 is checked Checkbox will also be checked. The problem is there are two codes on the default of Checkbox "If(ThisItem.'Keep/ Remove' = "Keep", true, false)" and "Checkbox3.Value" powerapps doesn't accept both is it possible to keep both codes?

  • eka24 Profile Picture
    20,923 on at
     

    I suggest:

    1. On the Default of the Checkbox outside the Gallery:  

       OnCheck property: UpdateContext({varCheck:true})
       OnUnCheck property: UpdateContext({varCheck:false})
     
    2.  On the Default of the Checkbox Inside the Gallery:  

          If(varCheck =true,true,

          If(ThisItem.'Keep/ Remove' = "Keep", true, false))

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

    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.

    Consider Checking My Youtube Channel

     

     

      

     

  • jan_mac Profile Picture
    106 on at

    Thank you for your response the check all box is now working however the uncheck of the check all is not working if the  check box inside the gallery is already checked.

  • KvB1 Profile Picture
    1,596 on at

    The default value for the checkboxes inside the gallery are based on a column value correct?

    If so you can add a formula to both OnCheck and OnUncheck where you patch the column for all records in the gallery with keep or remove.

  • Verified answer
    eka24 Profile Picture
    20,923 on at

    Change the approach to:

    1. On the Default of the Checkbox outside the Gallery:  

       OnCheck property: UpdateContext({varCheck:true})
       OnUnCheck property: UpdateContext({varCheck:false})
     
    2.  On the Default of the Checkbox Inside the Gallery:  

          If(varCheck =true,true,
         If(varCheck =false,false,

          If(ThisItem.'Keep/ Remove' = "Keep", true, false)))

     

    Note when you start the App, If(ThisItem.'Keep/ Remove' = "Keep", true, false) would work, then when you check the box outside, the other part of the formula would take over.

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

    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.

    Consider Checking My Youtube Channel

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard