I built an app that takes some text values and a file attachment and adds them to a SharePoint document library via a Power Automate flow. The screenshot is what the end user sees, and the code snippet below is what the "Upload" button does.
The problem I'm having: this only works ONCE, and then subsequent uploads don't actually work, despite the fact that it'll say "Your file has been submitted!" at the end (which you'll note, is the last line of my code). But on the second and other subsequent runs the file never makes it to SharePoint, the workflow never kicks off, and the time it takes for the form to say "...submitted!" is way faster on subsequent submits (an indicator that it's not actually doing anything).
If I refresh the browser after each submission then it works, but obviously that's not ideal for our users. What do I have to do to make this allow multiple submissions in a row? I tried the ResetForm thing but since this isn't technically a form I guess(? it's just a "screen" and that's not the same thing right?!), that's not working; anything I try with "ResetForm" seems to indicate that I'm not using the correct syntax, and I can't figure out what the syntax should be.
Note in my most recent version of the code, I try to reset the variables at the end in case that's what's causing an issue. Doesn't seem to make a difference one way or the other though.
Set(varDemoFromAttachmentControl, JSON(Image1.Image, IncludeBinaryData));
Set(varBase64Only, Mid(varDemoFromAttachmentControl, Find(",", varDemoFromAttachmentControl)+1, Len(varDemoFromAttachmentControl) - Find(",", varDemoFromAttachmentControl) -1));
If(!IsBlank(OnBehalfOfPicker.SelectedItems),Set(varOnBehalfOfEmail,OnBehalfOfPicker.Selected.Mail));
'UploadP-CardReceipt'.Run(Last(AttachmentControl.Attachments).Name,varBase64Only,Vendor.Text,Text(TransactionDate.SelectedDate,"[$-en-US]yyyy-mm-dd"),Amount.Text,varOnBehalfOfEmail,'Comments/Description'.Text,"unused",User().FullName);
Reset(Amount);Reset(TransactionDate);Reset(Vendor);Reset(OnBehalfOfPicker);Reset(AttachmentControl);Reset('Comments/Description');
Set(varDemoFromAttachmentControl, "");
Set(varBase64Only, "");
Set(varOnBehalfOfEmail, "");
Notify("Your file has been submitted!");

Report
All responses (
Answers (