Hi Everyone
This one has been bugging me for a while. On a slight variation on the below I had it writing to two sharepoint lists every time the FormIncident was submitted, but I only want it to write to both when it's a Newform. FormIncident is saving to SP list Incident, then I want it to Patch IncidentLog when FormIncident is new. So ReportID is a text column in the first list and ReportIdNumber is a Lookup in the second list
SubmitForm(FormIncident);Set(NewReport,FormIncident.LastSubmit);If(FormIncident.Mode=1,Patch(IncidentLog,Defaults(IncidentLog),{ReportIdNumber:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",Id:NewReport.ID,Value:NewReport.ReportID}}))
So to recap my intent is, when editing a exiting record, it only saves to the first database when submitted. But when creating a new record it saves the record to the first database and also saves to a single lookup column in a second database when submitted.
It is obvious what I want in my head, but I realise how it comes out in writing might be as clear as custard. any help would be much appreciated.