I have an app that is using a SharePoint list as a data source. I have a save button on a screen, and when I click save...I want to update an account if it already exists in the SharePoint list. Currently, my code is creating a duplicate entry. Here is what my logic looks like right now...
If(
IsBlank(
LookUp(
MySPList,
MyID = IDInput_1.Text
)
),
Collect(
MySPList,
{
MyID: IDInput_1.Text,
Title: AccountNameInput_1.Text,
ClientName: ClientSelect_1.Selected.Name,
ClientEmail: ClientEmailInput_1.Text,
FirmID: FirmIDInput_1.Text,
Strategy: StrategyInput_1.Selected.Value,
SelectAttach: Attachments,
Status: StatusDrpDwn.SelectedText,
EmailContent: EmailBody_1.Text
}
),
Patch(
MySPList,
LookUp(
MySPList,
MyID = IDInput_1.Text
),
{
Title: AccountNameInput_1.Text,
ClientName: ClientSelect_1.Selected.Name,
ClientEmail: ClientEmailInput_1.Text,
FirmID: FirmIDInput_1.Text,
Strategy: StrategyInput_1.Selected.Value,
SelectAttach: Attachments,
Status: StatusDrpDwn.SelectedText,
EmailContent: EmailBody_1.Text
}
)
);
How can I get this to just,
1 - update the record that already exist, or
2 - create an entry if it does not exist already?