AMPscript is a scripting language that you can embed within HTML emails, text emails, landing pages, SMS messages, and push notifications from MobilePush
Questions tagged [ampscript]
122 questions
0
votes
0 answers
How to create a lead of unsubscribed record (Coming from Marketing Cloud) in sales cloud?
Use Case - I have to fetch the unsubscribed records from All Subscribers and then all unsubscribed records will create in the lead object. (Custom way is required because if any error happens then SSJS or Ampscript can able to catch it.)
Step 1 -…

Gourav Jain
- 1
- 1
0
votes
0 answers
Add dataobject to a ampscript variable
I'm trying to add data as a tag property in a piece of JSON so that review site Trustpilot knows more details about the order confirmation we sent out.
I made the following setup but apparently this doesn't work. Trustpilot is giving me the feedback…

joren
- 89
- 1
- 9
0
votes
1 answer
crypto-js AES exchange with Marketing Cloud (AMPScript)
I'm trying to use crypto-js to manage encryption and decryption of data from Marketing Cloud (AMPScript).
I checked the lib docs and several "guides" on the web. The lib docs don't talk about using the IV, while other guides are very confusing.
I…

Sampgun
- 2,822
- 1
- 21
- 38
0
votes
1 answer
I am using BuildRowSetFromJSON() to read the Json, I am finding challenging in reading the json inside json, from the below json I need the content
{
"id": "chatcmpl-7bfXu0KfUg1NaPV4CVR3BRi0eFcPT",
"object": "chat.completion",
"created": 1689212194,
"model": "gpt-3.5-turbo-0613",
"choices": [{
"index": 0,
"message": {
"role": "assistant",
"content": "\n\n\n…

user3026271
- 1
- 1
0
votes
0 answers
Sending sms using transactional api from sfmc to Indian mobile number
I have created sms in content builder. Then tried triggering it to Indian mobile number
But I didn't receive any sms. In marketing cloud, its showing the sms is delivered.
I tried triggering to the following mobile number. eg: 91965566****
I need…
0
votes
0 answers
How could I set no-cors on amp-script?
Error that I get when I use amp-script:
Access to fetch at 'amp script src' from origin 'amp site' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your…

Samson Orr
- 21
- 3
0
votes
0 answers
How can I track and store the email open time for subscribers in my Salesforce Marketing Cloud data extension using Ampscript?
Is it possible to use Ampscript to record the email open time of subscribers and store it in a data extension in Salesforce Marketing Cloud?
I would like to save the email open time of an subscriber to my marketing cloud data extension to send some…

Monowar Hossain
- 1
- 1
0
votes
1 answer
How do I remove characters before the dot in a first name using substring and index of functions in ampscript and Salesforce Marketing Cloud?
■ If there is a name is followed with middle initial and dot, for example,
"Sara N." then remove the dot and two characters before it so that it
becomes "Sara"
■ If there are two first names BUT no middle initial with dot at the end, for
example…

MAS
- 1
0
votes
0 answers
How to add raw HTML / custom elements on amp-story-consent
I am trying to integrate "amp-consent" in my project where I want to keep an option to add multiple HTML elements like list, table, hyperlink but I don't see how to do it in documentation.
All I see is example which accepts 3 inputs in script under…

Yogesh Vadekar
- 119
- 2
- 9
0
votes
0 answers
Trying to add a new attribute in
I am trying to add a new attribute in amp-ad using amp-script but it's getting sanitized as you can check console warning.
Code
Expected: A new attribute being added to amp-ad namely x having value '1234'

Aarushi
- 1
- 1
0
votes
0 answers
New key values being added to JSON object using are being sanitized and removed
I am trying to add 3 new key pair values to a JSON object defined in tag using as need to add custom javascript to calculate those values but these values are being sanitized and removed in the response (getting the warning in console). I have…

Aarushi
- 1
- 1
0
votes
0 answers
AmpScript using Variables and IIF Statement
%%=IIF((@Loantype=="VA"),CONCAT("help",(@CurrentMonthlyPayment_PI_MIP),""),"")=%%
What is wrong with this? These are already established variables in my template and Data Extension. Just wondering what I am doing wrong. I'm no expert by any means…

akaczka
- 1
0
votes
0 answers
GMail annotation-promo images in preview tab not working in the emails triggered from SFMC
I am adding annotation for Gmail recipients into an email. I am using SFMC.
I added as JSON-LD in a script tag within the head of HTML of my email and that did work.
Then tried to create the annotation using AMP Script Concats to build the script…

Archana Selvakumaran
- 13
- 2
0
votes
0 answers
How to get ssjs variable(concat of different variables) to HTML href tag? It's like a link for tracking shipment in the email
I have a ssjs variable str(it has multiple variables concated) to create dynamic link in the email
I want to send this var to HTML -a href tag to create a link to track shipment. Please let me know the logic.
To create a link by using ssjs variable…

swetha a
- 1
0
votes
0 answers
Inline AmpScript Help Needed
Can the below 2 codes work as one inline ampScript on the html page? For example, the following is the copy I want to turn dynamic: Until 30 March 2023, you can get our boiler cover2 from £7.50 a month for your first 6 months. That’s half the usual…

Andrew Soko
- 1
- 1