2

I am trying to create variable which consists of other variables and some text, how can I do this? It doesn't seem to work when using the following code:

set @content = '{
 "Subscribers": [{"MobileNumber": "1122334455667", "SubscriberKey": "@subscriberKey"}],
 "Subscribe": true,
 "Resubscribe": true,
 "keyword": "TEST",
 "Override": true,
 "messageText": "Test Message!"
}'
2

You will need to use the concat() function, I also tend to not use line breaks inside of AMPscript setting as it usually causes issues with the rendering of the script/content when I do.

See below:

set @content = CONCAT('{"Subscribers": [{"MobileNumber": "1122334455667", "SubscriberKey": "',@subscriberKey,'"}],"Subscribe": true,"Resubscribe": true,  "keyword": "TEST", "Override": true, "messageText": "Test Message!"}')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.