Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Conditional Scheduling

KamenRider
11 - Bolide

Hi,

 

I have a workflow that is going to run in a server. I would like to schedule it twice. When it detects a file on the first run, it will automatically run. But it will no longer run on the second schedule. But if on the first run, it does not detect the file, it will not run. On the second run, if it detects, it will run. I am using a directory tool to point the folder or files location. I would like it to create a log that will contains the filenames and dates. 

 

Please show me a sample workflow on how to do it.

 

Thanks,

Kamen

17 REPLIES 17
binuacs
21 - Polaris

@KamenRider in your above workflow make sure you are reading the Email Status from the same file and updating the same file, so when it read first time the email_Sent flag is set to 0 hence it will send the mail and update the variable to 1, for the subsequent run it will not trigger any emails

 

Note: There is a problem once the 3 runs completed you need to re-set the email_set flag to 0 other wise the flag will always 1 and it will never sent email for a fresh run

image.png

KamenRider
11 - Bolide

HI @binuacs 

 

Thanks for the response. I noticed that the formula tool has no contents. I used this formula "IF ISNULL([Email Sent]) OR [Email Sent] = 0 THEN 1 ELSE [Email Sent] ENDIF". While it works, on the second run, it has no value. What do you think?

 

no content.PNG

Please advise.

Kamen

 

binuacs
21 - Polaris

@KamenRider sorry i missed that part in the formula tool, your formula should work,

 

in the second run the [Email Sent] field is 1 and the filter tool just filtering out all the records to the False anchor of the filter tool

 

image.png

binuacs
21 - Polaris

@KamenRider can you update the workflow like below and try again

 

image.png

KamenRider
11 - Bolide

HI @binuacs 

 

I've noticed that the number of columns keeps increasing, and the "email status" column in the Excel file is empty after the first run. Is this expected behavior?

 

increasing.PNG

one missing.PNG

Please advise.

 

Kamen

KamenRider
11 - Bolide

Hi @binuacs 

 

Not sure if this is the correct solution but seems to be working. After the formula "Email Sent", I added a select tool to select only the "Email Sent" field name and added after the Unique tool to remove duplication of "1". I noticed that this also remove the duplication that has been created in the output file.

 

solution.PNG

Please advise

Kamen

binuacs
21 - Polaris

@KamenRider You are correct, you should be using the select tool and only allow the email sent field to write in the email status file, 

KamenRider
11 - Bolide

Thanks @binuacs  for your advice and assistance. Closing this inquiries.

 

Kamen