Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Condition in Scheduler to send and email.

Avatar

Level 2

Good afternoon,

 

Can you help me with this need: I have to schedule a flow to run, for example, 5 days after the first delivery that is in an initial workflow has been sent. My idea is to put a scheduler that runs every day and then a condition to validate the eventdate of the first workflow if it occurred 5 days ago in order to send the second workflow.

 

Cheers

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hello!!!

I found a way to get back to the contacts that were sent an email a few days ago. For example, contact those who received an email 5 days ago. So I start from the DeliveryLogs table and the EventDate field. What I do is the following: ToDate(EventDate) = ToDate(AddDays(GetDate, -5))
It is a little longer but it helped me to learn a little more. I also appreciate your suggestion that I will put into practice.

Cheers

View solution in original post

4 Replies

Avatar

Community Advisor

Hello @Yamila1981 ,

you are not far from the result. Event date on workflow does not exists (last run or last modified but it may result in wrong results ) Query all deliveries instead, with contact day that is 5 days ago, with  the use of dateOnly() on both contact date and 4 days ago expressions and run it daily

 

Marcel

Avatar

Correct answer by
Level 2

Hello!!!

I found a way to get back to the contacts that were sent an email a few days ago. For example, contact those who received an email 5 days ago. So I start from the DeliveryLogs table and the EventDate field. What I do is the following: ToDate(EventDate) = ToDate(AddDays(GetDate, -5))
It is a little longer but it helped me to learn a little more. I also appreciate your suggestion that I will put into practice.

Cheers

Avatar

Level 2

Hi @Yamila1981 ,

You can make a query activity on xtk:workflow table which fetches workflows on basis of their last execution using date-time function "DaysAgo(5)". Now the DaysAgo() function returns the date and current time so you can wrap this function under DateOnly so the start time is 00:00.
Here is an query condition example you may use on your side to achieve this where this query will return all workflows that were processed on or after 00:00 5 days ago to 23:59. 🙂 

_Shubham_Goyal__0-1661239823184.png

 

 
Cheers,

Shubham

Avatar

Level 2

Hello _Shubham_Goyal_!!!

I found a way to get back to the contacts that were sent an email a few days ago. For example, contact those who received an email 5 days ago. So I start from the DeliveryLogs table and the EventDate field. What I do is the following: ToDate(EventDate) = ToDate(AddDays(GetDate, -5))
It is a little longer but it helped me to learn a little more. I also appreciate your suggestion that I will put into practice.

Cheers