Hi everyone, looking for some help!
This Adobe blog post states "If your Custom Code is JavaScript, then you can now return a promise in conditions or actions. The next condition or action will wait for the promise to resolve before executing."
I'm struggling to figure out how to do this. Has anyone got a simple JavaScript code example they could share? (i.e. return a promise in an action so that the following action waits)
Solved! Go to Solution.
Here's something you can try
// action1
return new Promise(function(resolve, reject) { setTimeout(function() { var thankGodItIsFriday = (new Date().getDay() === 5) if (thankGodItIsFriday) { resolve(); } else { reject(); } }, 1000); }); }
Editing to add article reference:
Here's a good read around async and an example as well.
https://www.datanalyst.info/web_analytics/adobe-launch/launch-async-sequential/
Here's something you can try
// action1
return new Promise(function(resolve, reject) { setTimeout(function() { var thankGodItIsFriday = (new Date().getDay() === 5) if (thankGodItIsFriday) { resolve(); } else { reject(); } }, 1000); }); }
Editing to add article reference:
Here's a good read around async and an example as well.
https://www.datanalyst.info/web_analytics/adobe-launch/launch-async-sequential/