I have been asked to explore Build Process Automation to develop some proof of concept projects.
I am vaguely familiar with JavaScript, but still learning.
My initial test is using agent version 3.16 and is intended to delete files from a file server folder older than a specified date.
I am using Get File Collection to retrieve the files, For Each to loop through each one, and Get Information to examine the last modified date/time (mtime) for comparison against my as-of deletion date.
(Steps 7 and 8 are just Log messages so I can see values while debugging)

Here is the problem: In order to only delete older files and skip newer files, I am trying to use the Condition control with this comparison (as recommended by one of the tutorials I reviewed).
When I use ==, !==, or ===, and press the Test button, the status shows Green, but whenever I use <, >, <=, or >=, the status shows Red producing an error condition that causes the process to fail.

Any thoughts, suggestions, or recommendations would be greatly appreciated.
Thanks
Request clarification before answering.
I worked around the issue by moving the comparison out of the Condition into a Custom Script that set a flag.
I then changed the Condition to compare the flag == "X", which evaluated to True or False.
Not sure why I had to do that since the tutorial examples showed I could compare numeric values to some limit (e.g., Step5.total < 1000), which would evaluate to True or False.
Curious why my comparison of two variables was invalid (Step6.returnedValues < Step2.deletionDate) when the comparison of a value with a literal is valid.
Thanks anyway 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.