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 / Add Checkbox column to...
Power Apps
Unanswered

Add Checkbox column to gallery

(0) ShareShare
ReportReport
Posted on by 13

Hi all, 

I would like to create a checklist that people can randomly check line(s) or row(s) on it. I have already connected a gallary to the data source and populated the information that I need for each line. How can I add a checkbox at the end of each line, then convert the checked answers to "Yes"/"No" for checked line(s) in the data source? Also, is it possible to add a short comment section for each line? 

 

Thank you so much!

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Yin,

    Do you have a column (Field) in your datasource that reduces to true or false? Does your datasource have a long text type field for your comments. Without these fields, you can add the controls but nothing in them will be saved for the next session.

  • Yin Profile Picture
    13 on at

    @Drrickryp

     

    Thanks for the reply. I will add two columns, one for True/False, one for the short comment. After that, how should I add the editable checkbox to the gallery? 

     

    Thank you so much,

    Yin

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Yin,

    You would use a Patch() function to do it.  There are two ways to collect the data from a gallery. It could be done by triggering the Patch each time something changes in the control or you could do it by adding a button or icon to the row and Patching both controls at the same time.  I will describe the latter way.  Say your two controls are named Checkbox1 and Textinput1.  The OnSelect property of the patching icon would be

    Patch(yourdatasource, ThisItem, {truefalsecolumnname:Checkbox1.Value,yourcommentcolumnname:Textbox1.Text})

     

  • Yin Profile Picture
    13 on at

    @Drrickryp

    I am not familiar with patch function. Will spend some time on it. For adding the button or icon that you mentioned as the 2nd way, do you mean add it to each row? If so, what is the efficient way to do that? Because my datasource has about 1000 rows.

     

    Thank you so much for your quick reply!

    Yin

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Yin,

    You click on the litle pencil in the upper left corner of the gallery and then insert the controls to the first row.  They will then populate down the gallery into all of the rows.  FYI, the Patch() function is one of the most versatile and misunderstood functions in Powerapps. If you want to master it, I would start with one of Shane Young's videos (@Shanescows) on the patch function at https://www.youtube.com/watch?v=gX5q_V3U8-s. 

    BTW, what I am suggesting to you is an atypical way to use a gallery and you probably won't find examples of it that easily.  Most commonly, you navigate to an Edit form and make changes to a record from there.

  • Yin Profile Picture
    13 on at

    @Drrickryp

    I have already added a column for the checkbox in the original datasource. If adding a control in the gallery for each row, do I have to link the control to the column for each row in order to save the checkbox data? 

     

    Thank you so much, 

    Yin

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    In the Default property of the control, type in ThisItem.  and all of your columns will show up.  Choose the correct column for the control from the list.   So for example, if you click on the checkbox control and go to the Default property and type in ThisItem.MyCheckboxColumnName it will show you what the current value in that column is for that record. (substitute the checkbox column name for MyCheckboxColumnName) You don't have to specifically link them because the Patch function will take the value of the control and apply it to the field.  That is what it does.    

  • Yin Profile Picture
    13 on at

    @Drrickryp

    You replies are really helpful. I will play with them to see if I can make it. 

     

    Thank you so much for your time and the great help!

    Yin

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard