Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Server Discussions

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

Abort scheduling when filter is true

MathiasL
7 - Meteor

Hi,

we have recently installed Alteryx Server in our organization, which has opened up great new possibilities, especially with possibilty to schedule workflwos for automatic execution. But now i'm facing the following problem_

 

I want to run a workflow at the beginning of the month at regular intervals (every 1-2 hours) which should then tell me if certain values are already in a database or not. In case of "yes, values are included" the workflow should send out an e-mail, so that the persons concerned know - otherwise nothing should happen. So far so simple. But how can i let the server stop executing the workflow after sending the mail? (The worst case would be, that the mail will be send every 1-2 hour until the end of the scheduling settings)

 

Thanks in advance

Mathias

 

6 REPLIES 6
Thableaus
17 - Castor
17 - Castor

Hi @MathiasL 

try to insert the email tool inside a macro, this way you can control its execution better.

 

cheers,

MathiasL
7 - Meteor

Hey @Thableaus ,

thx for your answer, but i do not quite follow your argumentation. Why should making a (Standard?) macro solve the above problem? Can the settings of a macro be initalized, such that it only runs one time?

 

Thableaus
17 - Castor
17 - Castor

@MathiasL 


Sorry, I totally misinterpreted your request. I thought you were trying to control the execution of the email tool, but it seems you're trying to control the schedule so it stops after it achieves its goal.

 

Now, I understand what you're saying. I think what you could do is use the Gallery API to disable the schedule if the condition is met (if you are on version 21.4+, you can use the v3 api). The only problem is that you would need to find a way to enable it again for next month, when the workflow starts looking for new records.

I think it would be the most effective way, since this also cleans up the queue of your Alteryx Server (you wouldn't have a workflow running every 1-2 hours again). 

 

What is the "trigger" or "flag" that indicates that the records are present in the database? I guess this is the main point, if you can control this logic, you could also control what happens next in your workflow. Is it time based? Does it look for records from that month?

 

Cheers,

MathiasL
7 - Meteor

@Thableaus 

 

The data comes in at the beginning of the new month (between the first three days mostly) and has the last day of the previous month as it's validity date. Then i simply count the records - i filter on the current validity date (which runs automatically - that means, that the workflow knows, when he runs for example on 2th september, the vaild date for now is the 31st of august), and then have a look if the amount of records is >0 or 0 on that date. The Filter Tool then decides if an email will be sent (amount >0) or not (amount=0).

 

Thableaus
17 - Castor
17 - Castor

@MathiasL I think what you could do without messing with the API is to create a flag in the same table (or a separate table) and check for that flag in the specific period as well.

 

Whenever the filter passes the true the condition (amount >0), you can then flag a field saying that the records have been passed and an email has been sent.

Then, add this flag to the filter condition to prevent it from going to the TRUE side over and over again.

 

With the date, the flag, and the amount, you can create a specific condition to send the email just once.

 

Cheers,

MathiasL
7 - Meteor

Thanks @Thableaus - that was the hint i needed. I have know created a separate file, where the date of the month will be written to if the data in the database is available and the mail will be sent. The workflow then knows in the next iteration that there is already the current month mentioned in the file but with my filter criteria now doesn't send an email anymore. I hope this works - i try to test this version already for the next few days.

 

Mathias