Using Profile Script token values in Activities A/B test custom code
Hi, for Profile Scripts you can use JavaScript arrays and objects as the values and it works fine within the Profile Script. However accessing the value in an Activity A/B test via Custom Code Modifications the values aren't deserialized the same.
Profile Script (user.testValue)
return ['test', 'blue'];
or
return {key1: 1, key2: 2};
Within an Activity A/B test modification custom code
var profileValue = "${user.testValue}";
console.log(profileValue);
The console output will be
and
Basically for string arrays, the quotes are removed when accessing the value within an Activity and the JS object is returned in a different format. Is there a method of accessing the token values other than ${user.token} that would retrieve the value correctly?
I only found this storing an array of strings in a profile attribute thread with the same issue, but the answer didn't actually address the question.
Thanks.