Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Patching Mutli select Checkbox into a Sharepoint list

(0) ShareShare
ReportReport
Posted on by

I have choice column in my SharePoint list , In my PowerApps form I have added a gallery in inside the DataCard and added Multiselect checkbox for the values, 

Onsubmit of my form I want to patch these values into my SharePoint list , I've tried following formulas but its not working 

Could anyone please help me to fix it 

Patch(Risk_Database, ThisItem,{'Risk Assessment Confirmed':Gallery1.Selected.Values})

  • Verified answer
    v-yueyun-msft Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi , @Danny_Dicaprio 

    Patch function first parameter is the Datasource: 

    Risk_Database

    So we are updating the item in this datasource using the Patch() function.

     

    For the second parameter  in the Patch() function, we need to put the one of the record/row in this Datasouce.

     

    So like in my side , My Gallery-Items is just the Datasource, so when i use the Gallery.Selected , it will return one of the  record/row in this Datasouce:

    vyueyunmsft_0-1701934129521.png

     

     

    But in your side , your Gallry6-Items , you use the items :

     Gallery 6 item property : Choices([@Risk_Database].'Risk Assessment Confirmed')

    This is only one of the columns , so the Patch() function can not identify which item need to update.

     

    Best Regards,

    Yueyun Zhang

  • Danny_Dicaprio Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list
     Hi Gallery 6 item property : Choices([@Risk_Database].'Risk Assessment Confirmed')

    Form Properties DefaultMode : VarFormmode
    Item : VarItem

    If I add VarItem in my Patch function No error is showing
    I dn;t know why the patch function is not taking Gallery6.selected



  • v-yueyun-msft Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi , @Danny_Dicaprio 

    What is your Gallery6 -items property?

    In my side ,i put just the datasource here :

    vyueyunmsft_0-1701930241067.png

    And you said that , it works when you use :

    varItem

    What is the differencr between the varItem and the Gallery6.Selected.?

     

    Best Regards,

    Yueyun Zhang

  • Danny_Dicaprio Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi @v-yueyun-msft   Sorry for the delayed response. 

    The Column is a Multiselect Column in my SharePoint list.

    So this one is perfectly working in my Onselect Properties of my button 

    Patch(Risk_Database , varItem ,{'Risk Assessment Confirmed': varChoices,Title:varItem.Title}); Clear(varChoices);SubmitForm(Form4)

    But Iam able to check only one checkbox, the checkbox is not getting Multiselect ,

    Update property of my Risk Assessment Datacard; Gallery6.Selected

    Item Property of my Gallery: Choices([@Risk_Database].'Risk Assessment Confirmed')

    On select of my Gallery: ClearCollect(varChoices ,ThisItem.Value)

    Checkbox Text: ThisItem.Value

    Checkbox- OnCheck: Collect(varChoices,ThisItem)

    Checkbox- OnUncheck: Remove(varChoices,ThisItem)

    CheckBox- Default : Self.Text in Concat(varChoices,Value,",")

    If I add Gallery6. Selected inside the patch formula

    Danny_Dicaprio_0-1701929280782.png

     

  • WarrenBelz Profile Picture
    146,635 Most Valuable Professional on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    @Danny_Dicaprio ,

    I will leave you with @v-yueyun-msft as this was an alternative, however I can assure you the code is correct if you are using it from a control inside your gallery on a multi-select column and all your control and field references are correct (I use it myself regularly)

  • v-yueyun-msft Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi , @Danny_Dicaprio 

    The second parameter in the Patch function need to put the record which item you need to patch/update in your sharePoint.

     

    In my side , i use the Gallery1.Selected, and this item i need to update its choices.

    vyueyunmsft_0-1701675336478.png

    And the third parameter :

    (1)If the column is multiple choices , we need to pass this format of the table:

    vyueyunmsft_2-1701675449933.png

     

    (2)If the column is  a single choice column , we need to pass a reord:

    {Value: "Choice 1"}

     

    And in your side , how can you get the varItem? 

    For your error code , you can also try to use this code :

    Patch(ChoicesTest , varItem ,{MulChoices: varChoices,Title:varItem.Title}); Clear(varChoices);

     

    Best Regards,

    Yueyun Zhang

     

  • Danny_Dicaprio Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    I tried both in my allowing Mutiple values turn on and off.

    Ia passing these values in a button  which ahs a property of Submitform(form4)

    Danny_Dicaprio_0-1701674991988.pngDanny_Dicaprio_1-1701675008355.png

     

     

  • v-yueyun-msft Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi , @Danny_Dicaprio 

    Thanks for your quick response ! Dose your column open the multiple options[Allow multiple selections] in sharepoint list?

    Or your column is a single choice column?

    vyueyunmsft_0-1701674000097.png

    The Gallery in your datacard , its items property is :
    Choices([@ChoicesTest].MulChoices)

    And you may try to use this code :

     

    Patch(ChoicesTest , varItem ,{MulChoices: varChoices}); Clear(varChoices);

     

     

    And where you put this patch code ?

     

    Best Regards,

    Yueyun Zhang

  • Danny_Dicaprio Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi I've set formode as VarFormode  and Item VarItem

    Danny_Dicaprio_0-1701673436342.png

     

    If u see the below screenshot it showing that expected type record but recieved Table 

    Danny_Dicaprio_1-1701673552363.png

     

     

    If the user clicks on the checkbox I want the checked checkbox values to recorded in SP List 

    Danny_Dicaprio_2-1701673634157.png

     

    Danny_Dicaprio_3-1701673674973.png

     

  • v-yueyun-msft Profile Picture
    on at
    Re: Patching Mutli select Checkbox into a Sharepoint list

    Hi , @Danny_Dicaprio 

    Thanks for your quick response!!!

    For this Gallery we do not need to configure the OnSelect properties. 

    So how do you identify which item you need to update/patch? (which row you need to update?)

     

    So what's code you put in the Form-Item?

    vyueyunmsft_0-1701673115152.png

     

     

    Best Regards,

    Yueyun Zhang

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,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard