I have an app that allows users to submit vendor payment requests. Upon selecting the submit button, a PDF of the form is generated automatically. On random occasions we have been noticing that the PDF generates incorrectly and it is reflecting the information inputted by the user of a previous request. I am not sure how this is possible if the PDF workflow is picking up the correct ID of the request. We have seen this happening in high volumes of requests but also noticed on slow days it still happens.
The issue is that sometimes the PDF shows data from a previous request instead of the current one. This happens because the app or flow picks up old or incorrect data due to timing or variable handling issues.
Make sure the form is submitted and saved before generating the PDF
SubmitForm(Form1); If(Form1.Valid, Set(varCurrentID, Form1.LastSubmit.ID); // Start PDF logic here )
In Power Automate, do not use input data directly. Instead, use the ID from Power Apps and fetch the latest data
Use "Get item" action (for SharePoint) or "Get row" (for Dataverse) based on the ID you received
Do not generate PDF immediately after submit without checking if submit was successful
Avoid using global variables to store form data unless you reset them after each use
Set(varFormData, Blank())
Reset the form after submit to clear previous values
ResetForm(Form1)
In Power Automate, log the received ID and output data to a SharePoint list or file to trace errors if needed
This will ensure the PDF picks up only the current request's data and not any old or cached value.
Was this reply helpful?YesNo
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.