Using DayofWeek in a workflow within a "Test" preposition (True or False)

Avatar

Avatar
Validate 1
Level 1
Cyyyb1990
Level 1

Like

1 like

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
Cyyyb1990
Level 1

Like

1 like

Total Posts

1 post

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
Cyyyb1990
Level 1

24-01-2017

Hi,

I was testing some things in Adobe Campaign and came accross the - AdobeCampaign_How_To_Setup_a_birthday_mailing_workflow.pdf 

This gave me an idea where I could create the same with DayofWeek so for example if I want a specific email sent on a Monday or on a Tuesday or a Thursday I just need to set it with the correct javascript  in a "Test" preposition as true and if any other day than Monday it is "no" leaping to another "Test" preposition until it finds the correct day and sends the appropriate email.

I cannot do this with the scheduler since I want to use it for people that have registered with us for example 4 days ago (which was a Friday) but if they registered today in four days it will be Saturday.

Unfortunately so far I have not been able to find the right solution for this. Is anyone able to help please or refer some documentation that might help?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile

Avatar
Springboard
MVP
Amit_Kumar
MVP

Likes

329 likes

Total Posts

649 posts

Correct reply

231 solutions
Top badges earned
Springboard
Ignite 5
Ignite 3
Ignite 1
Validate 10
View profile
Amit_Kumar
MVP

24-01-2017

If I understood your question correctly then you are looking the way to get the day of week in js.

// get the last modified date and pass that to the following function. //this will return a number XtkLibrary.WeekDay(date);

 

if this is not available in your js(despite of loading correct dependency) then you can use following:

WeekDay: function(ts) { if( ts === null ) return null; var date = new Date(ts); var res = date.getDay(); // JS is 0 for Sunday, whereas funclist is 0 for Monday if( res == 0 ) return 6; return (res-1); }

then you can use your business logic accordingly.

Answers (0)