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 / populate yes/no column...
Power Apps
Answered

populate yes/no column from checkbox in powerapps

(0) ShareShare
ReportReport
Posted on by 88

Hi everyone

 

I am trying to populate a Yes/No column from a checkbox in powerapps. 

 

The checkbox is not in a gallery or a form, so i was thinking to do this by the oncheck function and a patch, but i cant make it work. 

how do i patch the yes/no column from my checkbox in powerapps? 

 

Sharepoint list: "Segment 3 takt checkboxes"

Column name: Checkbox meeting 1

column type: yes/no

 

i am pretty new for powerapps, so please explain as simple as possible, thanks 🙂

Categories:
I have the same question (0)
  • ganeshsanap Profile Picture
    1,555 on at

    @Snow_89 You can use below formula to update yes/no column: 

     

    Patch(
    	'Segment 3 takt checkboxes',
    	ID = xxx,
    	{ 'CheckboxMeeting1': checkboxControlName.Value }
    )

     

    If you want to create new item in list: 

     

    Patch(
    	'Segment 3 takt checkboxes',
    	Defaults('Segment 3 takt checkboxes'),
    	{ 'CheckboxMeeting1': checkboxControlName.Value }
    )

     

    Kindly replace list name, column names & checkbox control names as per your app/data.


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

    Best Regards,

    Ganesh Sanap

    Blog site 

  • Snow_89 Profile Picture
    88 on at

    Hi, 

     

    so it would be something like: 

     

    Patch(
    'Segment 3 takt checkboxes',
    ID = xxx,
    { 'CheckboxMeeting1': Checkbox2.Value }
    )


    what informations should i put in the ID?

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Snow_89,

    Do you want to assign the Checkbox text to a Yes/No column?

    Could you please share a bit more about the sceanrio?

    Actually, when you save a Text value from your app into the Boolean type column, you must provide a Boolean value for the Yes/No column rather than a Text value.

    If you want to save a Text value into the Yes/No column in your SP list within PowerApps, I am afraid that there is no way to achieve your needs in PowerApps currently.

    As an alternative solution, please consider change the column type into a Single-line-text type.

    Then you could set the Yes/No button OnSelect as below:

     

    Patch(SPList2,LookUp(SPList2,ID=xxx),{Test:"Yes"})

     

    Further, if you do not want to patch the Checkbox text to the Yes/No column, you could directly set the OnCheck property as below:

     

    Patch(
     SPList2,
     Defaults(SPList2), // If you want to specify a certain record to update, please use the LookUp() function to specify a ID
     {
     YesNoColumn: Checkbox1.Value
     }
    )

     

    If you want to update the Yes/No column with a false value, please consider setting the OnUncheck as below:

     

    Patch(
     SPList2,
     LookUp(SPList2,ID=2),// Which means that you want to update Yes/No field for the second record
     {
     Test: Checkbox1.Value
     }
    )

     

    Hope it could help.

    Regards,

    Qi

  • ganeshsanap Profile Picture
    1,555 on at

    @Snow_89 If you are trying to update the list item --> Provide SharePoint list item ID for which you want to update yes/no column.

    If you want to create a new item --> Use Defaults('Segment 3 takt checkboxes')

     

    Also. replace CheckboxMeeting1 with the internal name of your yes/no column in SharePoint.


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

    For SharePoint/Power Platform blogs, visit: Ganesh Sanap Blogs

  • Snow_89 Profile Picture
    88 on at

    I how now made it work with this; 

     

    Patch(
    'Segment 3 takt checkboxes',
    Defaults('Segment 3 takt checkboxes'),
    { 'Checkbox Meeting 1': Checkbox2.Value }
    )

     

    But that does make a new record on the sp list every time, and does not remember the value, so the checkbox in powerapps will allways be reset when the app reloads. 
    How do i get it to remember and patch the record? 

    I am not sure what the ID: xxx is suppose to contain

  • ganeshsanap Profile Picture
    1,555 on at

    @Snow_89 When you are showing a screen/form with checkbox control for editing, you must be showing it for particular list item in SharePoint.

    You just have to refer that record or the ID of that record in Patch function to update the list item.

     

    Check this documentation for more information about Patch: Patch function in Power Apps 


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

    Best Regards,

    Ganesh Sanap

    Blog site 

  • Snow_89 Profile Picture
    88 on at

    But that would then be following: 

    Patch(
    'Segment 3 takt checkboxes',
    ID = 1,
    { 'Checkbox Meeting 2': Checkbox2_1.Value }
    )

    Yet i am getting the error you can see attached. Also i attached a photo from the sp list

     

     

    1.png
    2.png
  • Verified answer
    ganeshsanap Profile Picture
    1,555 on at

    @Snow_89 Try using: 

     

    Patch(
    'Segment 3 takt checkboxes',
    LookUp('Segment 3 takt checkboxes', ID = 1),
    { 'Checkbox Meeting 2': Checkbox2_1.Value }
    )

     

    OR 

     

    Patch(
    'Segment 3 takt checkboxes',
    {ID: 1},
    { 'Checkbox Meeting 2': Checkbox2_1.Value }
    )

     


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

    Best Regards,

    Ganesh Sanap

    Blog site 

  • Snow_89 Profile Picture
    88 on at

    That seems to write on the same record, Thank you!

    i will accept your solution, but before that - it does not remember the yes/no answer, so when the app reloads it will allways be blank

    does it need a lookup aswell? if you see the attached image, i want the checkbox to remember the value given, so if its a yes, to remember the yes for next time the app reloads

     

    Snow_89_0-1624443725479.png

     

  • Verified answer
    ganeshsanap Profile Picture
    1,555 on at

    @Snow_89 Yes, you need to set the Default property of your checkbox control based on the list item values.

    For Example

     

    LookUp('Segment 3 takt checkboxes', ID = 1).'Checkbox Meeting 2'

     

    OR 

     

    If(LookUp('Segment 3 takt checkboxes', ID = 1).'Checkbox Meeting 2' = true, true, false)

     

    This is just an example. You can set actual value based on your screen/form setup & list item selection. You might want to create a separate question for this to track it separately.


    Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

    Best Regards,

    Ganesh Sanap

    Blog site 

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard