I have a gallery which needs to Patch values to different SharePoint list when data s submitted. One list is working fine for the other list when only the Column "Status" value is "Completed" it needs to patch into the list. When completed if that value exists it must update or else create new entry in SharePoint.
ForAll(
Gallery2_1.AllItems As Deployment,
If(
!Is Blank(ComboBox3_14.Selected. Value) && ComboBox3_14.Selected. Value = "Completed",
Patch(
Deployment List,
Lookup(
Deployment_List,
Account Name = ComboBox2_3.Selected.'Name (Title)' && 'Deployment ID' = Value(IDDeploymentLbl.Text)
),
{
Use Case Name: TextInput4_1.Text,
Use Case Type: ComboBox3_Selected. Value,
'Details': TextInput4_4.Text,
Start Date: DatePicker1_2.Selected Date,
End Date: DatePicker1_3.SelectedDate,
Belt Members (Technical SPoCs): ComboBox3_6.SelectedItems,
'Primary Beneficiary': ComboBox3_5.Selected.Value,
'Benefit Impact Category': ComboBox3_7.Selected.Value,
'Impacted processes': TextInput4_5.Text,
Status: ComboBox3_14.Selected.Value
}
),
Patch(
Deployment_List,
Defaults(Deployment_List),
{
'Project Name': ComboBox3_15.Selected.Value,
AccountName: ComboBox2_3.Selected.'Name (Title)',
Use Case Name: TextInput4_1.Text,
Use Case Type: ComboBox3_Selected. Value,
'Details': TextInput4_4.Text,
Start Date: DatePicker1_2.Selected Date,
End Date: DatePicker1_3.SelectedDate,
Belt Members (Technical SPoCs): ComboBox3_6.SelectedItems,
'Primary Beneficiary': ComboBox3_5.Selected.Value,
'Benefit Impact Category': ComboBox3_7.Selected.Value,
'Impacted processes': TextInput4_5.Text,
Status: ComboBox3_14.Selected.Value,
'Deployment ID': Last(GenAIDeployment_List).'Deployment ID' + 1
}
)
)
);
But it is not creating and updating Properly. If I given For All is us creating Duplicate entries if not for all it is saving to SharePoint. From this gallery 2_1 I have to patch values to different SharePoint list.
Any help/suggestion on this.