File Management within a Loop plugins/JS/AutoIt/Powershell

Hi.

We need to the following process:
Create multiple print PDF documents from web sites and before printing/saving them, need to check if the file exists (to avoid file already exist msg), remove the file and then save the new file. Each page has a number at the end to identify number of sequence.

Have been searching for a solution to manage files within a loop or branching to a child workflow.
Have been using FileExists/FileDelete as plugins and through scripting with JavaScript, AutoIt and Powershell but have not been able to get the results expected.

What I need is to detect if a file exists and delete it or write info into a variable. When using each of the options, I display the name that needs to be identified and what value is being returned from the call.

All info is present but every time it is invoked, it returns non-existent, and the file is there.
When testing through Script and “hardcoded” it works like a charm.
Needed to do it on a shared drive (Y:) but also tried on local drive and same results.

What could I be doing wrong here?

Hi! Willem,

In the Delete Files step in the settings tab did you select the Delete for Each Row option?

Hi Seema. Thanks for your reply.
The issue where it all starts is that it does not detect that the file exists with FileExists. If I solve this, then I can move forward.

There is an issue reported in my log file, reported to support, that it cannot find the “userdata.properties” file. Think that has to do with what I am reporting.
Regards