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.

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Users online (4,237)