Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Patch Checkbox values into SharePoint list

(0) ShareShare
ReportReport
Posted on by 133
Hello All,
 
I have a SharePoint list page with my CheckBox values.
 
 
I have populated above values using a gallery Control.
 
 
Wrote Code on
OnCheck  - Collect(colJustification,ThisItem)
OnUnCheck events - Remove(colJustification,ThisItem)
 
When I tried with this code
 
'Justification to Forego Competitive Bid Process': colJustification
 
Got Below error
 
 
I also tried with .Value and .Text, but thats not working either.
 
Here is the Column setting in SharePoint
 
Categories:
  • PraveenC Profile Picture
    133 on at
    Patch Checkbox values into SharePoint list
    Hello @Nandit
     
    I have to use another Share point List and cant add the choices into a choices field directly as the length of each choice value is too long and we cant reduce their length. So I cant put the exact same values in both Share Point List and Choice column.
  • Suggested answer
    Nandit Profile Picture
    1,563 Super User 2025 Season 1 on at
    Patch Checkbox values into SharePoint list
     
    Here's what you should do. 
    1. Add the choice options you have in a separate list to the Choice column instead. 
    2. Populate your gallery Items with the Choices from the choice column
    3. OnCheck and OnUncheck properties will remain the same
    4. Add a button to the screen to save the selections in your SP List
     
    Here's how the solution will look:
    Choice Column
    Gallery Items:
    Choices([@SPList].choice)
    OnCheck
    Collect(colJustification,ThisItem)
    OnUnCheck
    Remove(colJustification,ThisItem)
    Patch button
    //Replace the LookUp with Defaults(SPList) to Patch as New items 
    
    Patch(
        SPList,
        LookUp(
            SPList,
            ID = 2
        ),
        {
            choice: Distinct(
                colJustification,
                Value
            )
        }
    )
     
    Final Result
     
    If you still wish you to use a separate list for Choices, you can BUT you will need populate the Choice column with the exact values as choices. 
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard