Hello,
i want to use the following code in a javascript activity but im getting an error :
var myPromise = new Promise(function(myResolve, myReject) {
setTimeout(function() { myResolve("I love You !!"); }, 3000);
});
myPromise.then(function(value) {
logInfo('Helllo Promise : '+value);
});
this is the error that i get : 02/04/2021 16:02:11 js7 JST-310000 ligne 2 : Promise is not defined.
do you have any solution please ?
Thanks in advance.
Views
Replies
Total Likes
Hi @JamesAlio
it is not there by deafult.
You may try create a new JS library and copy code from here for example.
Finally, load library in your JS node or connector via loadLibrary("your_schema:Your_new_file.js");
This is not tested. If code does not work for you try with different ones (look for min.js extension)
Regards,
Milan
Hi @JamesAlio,
Was the given solution helpful to resolve your query or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes
Hello @Sukrity_Wadhwa
no i still have the same problem. the Promise object is undefined in my Js Activity
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi James,
I guess Promise doesn't work in Adobe Campaign. ACC Javascript implementation is Spider Monkey, so it is probably ECMAScript 5 (2009) standard. Promises were introduced with ECMA 6 (ECMAScript 2015).
Regards, Marcin
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies