Hi,
I have a canvas app that connects to a CDS instance.
I have a gallery in which I have put a "Pick" button.
When this is pressed, it uses Patch to update a value on the Account called "Picked" and also runs a Flow with the following:
UpdateContext({pickedItem: ThisItem});
UpdateContext({patchResult: Patch([@Accounts], ThisItem, {Picked:currentUserEmail})});
If(Not(IsBlank(patchResult)) And IsEmpty(Errors([@Accounts])), Notify("Call Picked Successfully",NotificationType.Success),Notify("Error Picking Call", NotificationType.Error));
CreateAppointment.Run(ThisItem.Account);
The flow creates an Appointment based on the Account in ThisItem
Intermittently, the value passed into the flow isn't the correct Account, so the appointment is created for a different Account.
I can't find any reason, or any pattern as to why sometimes ThisItem, doesn't in fact contain the details of the Gallery item where the button is pressed for passing to the flow.
The Patch to the Account works fine every time.
I really hope that someone can point out what I've done wrong here, because it feels flaky at best.
Any help would be greatly appreciated.
Cheers...
John