Displaying next pdf on userform without closing the form

Hi,

In my project, i display PDFs in loop on the userform, basis which the users have to fill the textboxes. Post clicking on submit, the userform is closed for the next set of code to be executed and again it gets opened to display the next pdf.

Is there anyway not to close the userform and have the code executed and display the next pdf? i used the key closeonsubmit and set it to false, even though it keeps the userform open, it doesnt display the next pdf/execute the next line of codes.

Hi @Yousuf_Ali,
If you are using a form from the UiPath.Form.Activities package then you can add a property “closeOnSubmit” with a “false” value to your submit button.
https://docs.uipath.com/activities/docs/real-time-forms#triggering-the-do-block

Hi,

The above solution works while writing the code in the do block of form. However before opening the form, i have a for each loop which opens the pdfs one by one from a folder, reads data from pdfs and assigns the required fields to variables and then the variables are passed in the userform and form opens.

Post clicking on submit even while using closeonsubmit, the code outside the do loop is not getting triggered because of which the next pdf and values extracted from it are not getting reflected in the form.

You can try to work with the flowchart project type instead of a sequence. So you could do a loop that will trigger the next file and return to the form again. Hope this makes sense.
Just an idea.