cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sebastiandcarri
Helper I
Helper I

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
sebastiandcarri
Helper I
Helper I

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
sebastiandcarri
Helper I
Helper I

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

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,253)