Re: Patch Comments and Checkbox to SharePoint List
If you want to update an existing record in SharePoint, you need to use the Patch function in a slightly different way. Instead of using Defaults(YourSharePointList) (which is used to create a new record), you need to specify the record you want to update. In your case, it's Gallery2.Selected. Here's how you can modify your Patch function:
Patch(
YourSharePointList, // replace with your SharePoint list name
Gallery2.Selected, // update the record selected in Gallery2
{
Title: "Some title", // replace with any mandatory field in your SharePoint list
Stage1ApprovalStatus: If(
CheckboxAgree.Value,
"1st Stage Approved",
CheckboxDisagree.Value,
"1st Stage Rejected"
),
ChangeStatus: If(
CheckboxAgree.Value,
"1st Stage Approved",
CheckboxDisagree.Value,
"1st Stage Rejected"
),
Stage1ApprovalComments: 'Stage1Approval-Comments'.Text // replace 'Stage1Approval-Comments' with your TextBox's name
}
)
I'm not exactly sure how you have your app set up but if this doesn't work for specifiying which record you could set a global variable in your onselect for you gallery....
Maybe something like
Patch(
YourSharePointList, // replace with your SharePoint list name
LookUp(MySharepointList, MyColumn = MyVariable)
{
Title: "Some title", // replace with any mandatory field in your SharePoint list
Stage1ApprovalStatus: If(
CheckboxAgree.Value,
"1st Stage Approved",
CheckboxDisagree.Value,
"1st Stage Rejected"
),
ChangeStatus: If(
CheckboxAgree.Value,
"1st Stage Approved",
CheckboxDisagree.Value,
"1st Stage Rejected"
),
Stage1ApprovalComments: 'Stage1Approval-Comments'.Text // replace 'Stage1Approval-Comments' with your TextBox's name
}
)
If this answers your question, please mark one of my replies as Accepted Solution