Page 1 of 1

Check if a file was submitted within a time of day

Posted: Wed May 16, 2018 5:00 pm
by GSBSwitch1
I have a workflow that is triggered by an email that is received through an Email Receive element with job data attached in a CSV format. This singular email is presently received on Monday and Thursday morning at 5AM.

I would like to trigger a notification email IF no data is received within a time window, such as 5AM-10AM on those given days.

Any ideas on creating this functionality?

I am a novice at scripting so please keep that in mind.

--Evan

Re: Check if a file was submitted within a time of day

Posted: Thu May 17, 2018 7:56 am
by r.zegwaard
This would require two scripts.
sample flow.png
sample flow.png (12.44 KiB) Viewed 3867 times
The first script should set a variable (flag) in the global-data of Switch. This flag gets set when a mail is received.
See topic "Maintaining global data" under "Scripting reference/Flow element module/Environment class" in the scripting manual.

The second script, which is timer-fired, has two tasks:
1) Reset the flag is time is before 5:00
2) Create a dummy-file as trigger if time is after 10:00 AND the flag is not set by the first script.

If you want it should even be possible to combine the two scripts into one, but i think this example is more straight forward.

Hope it helps ;)