cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Error Creating PDF with LastSubmit

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.

1 ACCEPTED SOLUTION

Accepted Solutions

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.

 

 

View solution in original post

1 REPLY 1

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.

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,235)