Expand my Community achievements bar.

SOLVED

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

Avatar

Level 1

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!

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

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.