Set Monitor Events Trigger within a for each loop

Hi, I am trying to set up a for each that performs a search for each row of a data table and pauses for the user to select a document to download. So far, the search process is fine. The issue is that, for each row in my data table, I need to have the automation pause after the search has been executed so that the user can select which file they want to download.

I’ve tried using the Monitor Events Trigger so that the automation would 1) perform the search for the first data table row 2) pause for the user to select the documents they want to download (the trigger) 3) go to the next search based on the next row of the data table. And repeat until all the data table rows have been searched for

The problem is that when using the Monitor Events activity only the code inside the Event Handler executes. Which means the automation never gets past the first data table row

I’ve seen a solution where someone built a flowchart to have the Monitor Events loop back to the main process. The issue is that, since I need to iterate through each data table row, I am afraid this will start the for each loop over from the start and just cause it to repeat the first row without end

Any suggestions for how I can work this out?


I suppose we can achieve it like roughly the following image. If your problem is another point, can you show us?

BTW, I think perhaps we should use not Trigger but Input Dialog which can have user select download file. The following post is similar with this case (dynamic input dialog items).


Thank you so much, Yoichi! This is exactly what I am trying to achieve. The issue is that when I try to run with the project set up like this, once the automation reaches the Monitor Events activity, it stops executing after the Event Handler code has run, even though I have code that comes after the Monitor Events activity.

Would this be typical behavior of the Monitor Events activity?

If so, I am thinking to try your alternative recommended solution of using the Input Dialog. If I am understanding correctly, this activity would pause the automation until the user has selected the file(s) they want to download and clicked OK to continue the process.

Since my user will likely need to open and check a few files to determine the ones they want to download (they won’t be able to identify them by name), I don’t know if setting up a drop-down with an array of file names would work. What I am thinking instead is, once the automation reaches the input dialog activity, to let the user explore the files as needed, clicking a checkbox for each one they want downloaded. And, once they are ready to continue, they can click OK on the input dialog box which will resume the process

Does this sound like a viable idea to you?

Whoops, small correction, after experimenting with that idea, I think a simple message box might work better in the idea I described above since the user won’t be sending a message or selecting an option from the input box.


For now, can you check RepeatForever Property of MonitorEvents activity?
The default value is true and this prevents go next activity. (We need to set False in this case.)

Does this sound like a viable idea to you?

Although i don’t get your business logic and/or requirement perfectly, it seems possible.


Blockquote For now, can you check RepeatForever Property of MonitorEvents activity?
The default value is true and this prevents go next activity. (We need to set False in this case.)

That worked! Thank you.

Sorry for not explaining the requirements more clearly. The automation I am designing is to perform a search for documents in a database based on criteria in an excel spreadsheet. The documents for each search criteria are displayed in tabular format, with checkboxes to select the doc(s) to download and a button to initiate the download process. Once the automation enters the search criteria for one doc, it is supposed to pause and let the user identify the correct documents (if any) for download. And, on the user’s cue, resume the process to save the documents to a specified folder.

I like the idea of using the Monitor Events activity except that it does not seem to as clearly allow for the possibility of there being no documents to download as does the message box with yes/no options.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.