Hello members of the community,
I am currently experiencing an issue that seems to be occuring randomly. I would guess about 30-40% of the time a new request is created via my application. So I have an application where users can fill out a form and upload attachments in order to get an approval. The documents are uploaded onto a sharepoint list and used with a seperate flow afterwards to mail them to other users. The relevant part and also where I am experiencing this issue is in the PowerApp. First of all its a Dataverse for teams environment and theres a dataverse table that saves a "Requestnumber" for each form that is submitted.
Quick explanation:
1. After clicking on the arrow, the form gets submitted as dataverse row entry and has a "Requestnumber"
2. The documents are uploaded to a sharepoint list and given in the column the corresponding "Requestnumber" and also an autogenerated number from the default column "ID" (there is no other column that matches "Id")
So since the error message "Network error when using patch function field "Id" is required" appears occasionally and I can not fully understand under which circumstances I thought maybe the time between the system assigning the auto generated number "ID" and me using it in my power automate flow was the issue. So I inserted a timer that creates a dummy record which I can then update with the actual data to bypass any time related issue. Spoiler: It still doesnt work smoothly and occasionally drops the error message and does not go forward with the power automate flow and also does appear under "placeholder Title" in the screenshot.
Heres my code for the "OnSelect" Property of my check mark icon when trying to submit a record
SubmitForm(EditForm1_2);;
Notify("Waiting for upload..."; NotificationType.Information; 5000);;
Set(newRecord;
Patch(Angebote; Defaults(Angebote);
{
Titel:"Placeholder Title";
Requestnumber:000000
}
)
);;
Set(TimerGo; true);;
then after that the Timer is started via a variable:
Duration: initially 5000 now 10000
OnTimerEnd property:
Set(newRecordRequestNumber; EditForm1_2.LastSubmit.Requestnumber);; //here the record gets the requestnumber from the dataverse entry
Patch(Angebote;
LookUp(Angebote; ID=newRecord.ID);
{
ID: newRecord.ID
Titel: "Angebotsdatei";
Requestnumber: Value(newRecordRequestNumber)
};
Form1.Updates);;
Set(TimerGo; false);;
UpdateContext({resetAttachment: true});;
Reset(Timer1)
I tried assigning "ID" manually but it just doesn't make a difference.
Could you please assist me in finding what is causing the error and fixing it? In my understanding the field "Id" is first of all called "ID" in the sharepoint List and also it is an autogenerated number which is created by default from Sharepoint.
Thanks and kind regards
Saki