web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error Creating PDF wit...
Power Apps
Answered

Error Creating PDF with LastSubmit

(0) ShareShare
ReportReport
Posted on by 46

Hi 

 

I have a custom app based in a sharepoint list.

 

The app gets information from users and when an user submits the information creates a PDF with that information, it also has a PenInput to get a digital signature.

 

For the first records the app worked but now I'm having problems because the pdf generated is not taking the information from the last submit record, it's taking the information from the record submitted before.

 

For example:

At 11:30 user A submitted a record and at 11:35 user B submitted another one. The pdf created for the B is taking the information from the user A and not the information that user B just submitted.

 

I don't really know why it's happening because for the first 20 users it worked and didn't have any problem.

 

I have a gallery that gets information from last submitted record and populates the pdf with this information. This galley is set on items with: Last(BD) - BD is the SharePoint List.

 

In the form I have a button with the next formula in OnSelect:

 

SubmitForm(Form1);

PenInput.Run( "Here I have HTML code to concatenate text with gally items", i.e:: &Concat(Gallery2.AllItems, ID) 
"and I have a PenInput to get a digital signature <img width='120px' src=" &JSON(PenInput1.Image, JSONFormat.IgnoreBinaryData) & ">
, "Ded"&Last(BD).Modified);
Reset(PenInput1);
NewForm(Form1)

 

PenInput is a flow, when I trigger it runs like this:  Run (Createfile_Filecontent,InitializeVariable_Value)

 

InitializeVariable_Value is an Ask in PowerApps to set the name in this case is this line in the formula: "Ded"&Last(BD).Modified)

Createfile_Filecontent is an Ask in PowerApps step to create the PDF and here is where the flow takes the html code, concat fields and PenInput.

 

I really don't understand why it worked for the first records and now it's failing, 

 

Thanks for your help and your time.

Categories:
I have the same question (0)
  • Verified answer
    sebastiandcarri Profile Picture
    46 on at

    I think I found what's happening. The PDF function takes the data from a Gallery and when the user submits the information the gallery doesn't update the LastSubmit immediately so the PDF is generated with the record before the one that just has been submitted. I don't know why it changed, in testing scenarios and for first 40 submits the application didn't show this error.

     

    I figure it out creating a new button and splitting the code, 1 button SubmitstheForm and other button creates the PDF, even if this is a way to solve the problem I don't want to add a new button just to create the PDF file.

     

    As I shared above I have one button to run everything, submit the form and then create the pdf. Is there a way to add a delay in the execution of the code and wait for the gallery to update the information from LastSubmit? or maybe a way to update the gallery immediately once the user submits the form  get the information from that last record?

     

    Thanks for your help.

     

     

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard