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})
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:
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
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
Hi , @Danny_Dicaprio
What is your Gallery6 -items property?
In my side ,i put just the datasource here :
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
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
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)
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.
And the third parameter :
(1)If the column is multiple choices , we need to pass this format of the table:
(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
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)
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?
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
Hi I've set formode as VarFormode and Item VarItem
If u see the below screenshot it showing that expected type record but recieved Table
If the user clicks on the checkbox I want the checked checkbox values to recorded in SP 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?
Best Regards,
Yueyun Zhang
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional