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

Cyyyb1990

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)

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)