How to open a pdf file through chrome browser on clicking a button by using uipath form

I am having 2 buttons on a UIForm,

  1. Open File - On click of this, pdf file should open via chrome browser
  2. Process File - On click of this, a file should move from one location to other.

I am to achieve the solution, the only issue is, when I click “Open File” button, its opening file multiple times as per the number of times the Form is opening.
please guide me to resolve this issue.

Hi @cbalakrishna

May i know why is your form opening multiple times in the first place did you set it to?

Did you use a anchor tag for opening the file?

Cheers

Hi Anil,

PFB screenshot for better analyzing of the issue.

On click of “Open” button, its opening twice as per the number of times the form appears.

On click of “Process” button, a form is closing by executing process sequence once(Perfect one)

Thank you in advance.

Regards,

Chaya Kumari B

SampleForm.zip (6.36 KB)

Hi Anil,

Kindly let me know your feedback.

Thanks & Regards,

Chaya Kumari B

1 Like

Hi @cbalakrishna

Please change the click type of open to submit and that should allow it to open only once

cheers

Hi Anil,

As you instructed, I followed the instructions but on click of “open”, its executing as number of times the form appears as I mentioned earlier. And “Process” is executing only once as irrespective of Form appears(Perfect one).

Thanks & Regards,

Chaya Kumari B

SampleForm.zip (3.7 KB)

Hi @cbalakrishna

Did you select reset option under submit? . If you select that then it would open only once. Please try with the same

Cheers

Please find the attachment before once. I have tried all the ways and kindly let me know your comments after seeing the xaml.

Hi @cbalakrishna

You are seeing this because forms are persistent. so, I removed the property you have in the conditions and it is working as expected. Please check the attached

image

SampleForm.zip (3.6 KB)

cheers

Thanks for the solution,

I do not want the form to be closed on click of “Open” button, instead I want to open a file.
On click of “Process” button , the form should close and the file should move from source to destination path.

I have tried searching, how to use “Events” action instead of “Submit” action on Open file case, but I am not getting any solution either in Uipath Forum or web search.

Kindly provide your comments.

Hi @cbalakrishna

Let me explain forms first

  1. Your form is persisting as opening multiple times because the do block gets executed for the form till you close the form or the current form is closed.
  2. Your form is not running more than loop times, it is running in the same do block because the form is not closed. If it closes only then it moves to next iteration. Else the open will execute only when you click it
  3. As per your logic the while loop that you gave executes only when you use close because the form activity ends there and a new loop starts with new form

So either remove the while loop or include a close for your open action as well . because both are not same as what you want

cheers

Hi Anil,

PFA of the updated one which is iterating through a folder to process files. Here, I am not using while loop for demo purpose.

  1. On click of “Open” button, file should open, and Form should not close.
  2. On click of “Process”, file should process, and Form should close.

The issue here is that, On click of “Open”, as number of times the Form is opening those number of times, the “opening file” message is popping out(logging those messages also)

As it is for example, I am using Word document, so even though its entering “open” sequence multiple times, its opened once.
For Business, PDF files are used, and it is opening with chrome browser multiple times.

image001.png

SampleForm_Updated.zip (32.1 KB)

Kindly provide the comments to the above issue.

Hi Team,
Please do respond.

Hi @cbalakrishna

As of now as workaround you can try checking if required file or browser is already opened and do not open again using a if condition

Cheers

Actually if “Open File” button is clicked N number of times also when form is opened, it will not open those N number of times.

But it is opening as many time times the for each iteration is happening.

Hi @cbalakrishna

So inside the do block use a if condition and check if the file already opened and only if not opened yet then use open or dont use it

It is gping through the same iteration but the if condition also will be executed always and will go to else if the file already is open

Cheers