We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [ampscript]

AMPscript is a proprietary scripting language for Salesforce Marketing Cloud products that you can embed within HTML emails, text emails, landing pages and SMS messages to control the content that is displayed to the individual consumer. It also provides functionality to track impressions and highlight which content areas get the most attention from the viewer.

506 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
3answers
160 views

Scalable Journeys in Marketing cloud with different templates

Is there any scalable way of designing a journey in Marketing Cloud which: Sends a different email (the template) depending on the current data data? i.e. a contact picklist value with 25 possible ...
7
votes
1answer
1k views

Why does ExactTarget not find a subscriber in job when creating a custom unsubscribe for Salesforce integration?

I have a custom preference center for a client with an ExactTarget account integrated with Salesforce. I have tried a couple of methods for unsubscribing a record through ampscript including the one ...
5
votes
1answer
344 views

AMPscript HTTPPost2 Parameters

I'm a bit lost with the HTTPPost2 function. According to the documentation, the fifth parameter is: used to contain string representation for the status of the HTTP request, such as OK. But this ...
5
votes
0answers
233 views

Use-cases for the WAT and WATP AMPScript functions

Do any of you fine folks know anything about the WAT() and WATP() AMPScript functions? I'm looking for a real use-case outside of the official documentation: Returns the values of the Web ...
5
votes
1answer
4k views

Print AMPscript Variable inside HTML <tag> as attributes

So I am using ExactTarget templates and content areas to build my emails. In my templates I have AMPscript variables defined in the < head > and that will determine how elements in my content areas ...
4
votes
0answers
34 views

claimrow() is claiming two rows for each subscriber when used in a journey

This one has me stumped. I have the following AMPScript in an email: %%[ var @em, @couponRow, @couponCode if _messagecontext == "PREVIEW" then set @couponCode = "XX TEST XX" else set @...
4
votes
1answer
151 views

Using AMPscript/SSJS to unsubscribe from a parent business unit on a CloudPage from a child business unit?

If you click 'Unsubscribe from All' on the Subscriber in the Subscriber Properties modal in the parent business unit's context or when you perform an SSJS subscriber.Unsubscribe(); on a CloudPage on ...
4
votes
0answers
509 views

Using Salesforce Landing page checkbox values to populate a SFDC field

I have an ExactTarget Landing Page form that is currently inserting a Lead into SFDC when submitted. The form has 3 checkbox options that (if possible) I'm trying to concatenate and insert into the '...
3
votes
1answer
56 views

Print reason for SQL query failing in SSJS

I built a Microsite which staff can you use to run one-off queries without having to create an activity and then run it or place it in an automation. It works great but is very basic - when you click ...
3
votes
0answers
68 views

How to control processing of AMPScript using execution context: Name

According to the documentation and The AMPScript Guide, it should be possible to control whether code in an AMPScript Block is interpreted by using a name for the script block. I am aware of the ...
3
votes
2answers
134 views

Is there a way to identify all the places a Content Block is used?

I'm trying to identify all the places a Content Block is used. The goal is to be able to reference what will be affected if a Content Block is modified. I've looked a the Asset in the REST API, but I ...
3
votes
0answers
75 views

Ampscript Attribute from Contact Model

i have searched the documentation with no luck. In an email i want to use a value that is from an attribute that has been configured through Attribute Groups within the Contact Builder Data Designer....
3
votes
0answers
124 views

Posting to a form, query string variable is not being picked up

I'm writing up a landing page in Marketing Cloud. The idea is that, for simplicities sake, the page would be able to re-activate a paused automation. So, here's my dashboard: Each of the "Activate" ...
3
votes
1answer
176 views

Can ClaimRow() be used to generate a unique ID for a Data Extension?

I want to generate a unique ID in a Data Extension each time a record is created via SmartCapture using Cloud Pages. I am trying to use the ClaimRow() function to do this by pulling the unique ID ...
3
votes
0answers
92 views

Pros and Cons of loading content for a welcome stream from a Data Extension

This may get flagged as it's opinion based, but I want to see what the experts think. We are about to build a Welcome Stream and I can do it one of two ways. The first way is to build it all as HTML ...
3
votes
0answers
394 views

How to Decrypt data in SFMC coming from API call from external system in Encrypted format

If data records are coming to SFMC Data Extension via API calls. And this data is encrypted by external system. I want to decrypt that data and store it in SFMC DE. How can I do it? Also, I am not ...
3
votes
0answers
509 views

SQL Query or Ampscript within Journey

This is more of a methodology or best-practice question. What I have: Users data extension Online stores data extension They are connected by the Subscriber_Key A [User] can have multiple ...
3
votes
0answers
301 views

MobileConnnect - customized “From” name & behaviour?

The MobileConnect instance that I work with, is based on a shared shortcode and then when we send texts out, we use a custom from name - and that is fine. Whenever we send an sms, it comes through ...
3
votes
0answers
142 views

How to do an Unsub event on a shared publication list?

I am working on a landing page, and right now, the code is all done in AMPScript (as that's what I'm most comfortable with). I have a one-click unsub page that is working great, except for cases ...
3
votes
2answers
3k views

Server-side JavaScript and JSON

I would like to extract the data from a Data Extension column and parse it as JSON and use the data as attributes in an email. How would I go about doing this? Is there a combination of AMPScript ...
3
votes
0answers
636 views

Valid email string decrypted with AMPscript DecryptSymmetric() returns false for isValidEmail()

I have the following ampscript above a landing page unsubscribe form. It appears as though the EncryptSymmetric from the test email and DecryptSymmetric on the landing page are working as expected, ...
3
votes
1answer
1k views

Exact Target Triggered Send using REST API with Data Extension

I would like to substitute some variables in my email template using ExactTarget's REST API. For example, in my email: %%[Substitute_var1]%% When I call it through REST, how its possible to ...
2
votes
1answer
34 views

Dynamic Flag for Deep Linking MC-Deep-Link

We use the "mc-deep-link" tag in our href to ensure we are either pushing our customer into our App environment or to our website if the app doesn't support that specific link. All our links are ...
2
votes
0answers
27 views

How to setup programmatically the background color of a marketing cloud Layout block

I am struggling with the possiblity of configuring programmatically the background color of a Layout Block that I have in Email Studio. I don't find the possibility of doing that using AMPSCript. It ...
2
votes
0answers
85 views

Parsing a date string in dd-MM-YYYY format with AMPscript

What's the best/simplest way to parse a date string in dd-MM-YYYY format with AMPscript? %%[ var @dateString1 var @date1 set @dateString1 = "21-08-2019" set @date1 = DateParse(@dateString1) ]%% ...
2
votes
0answers
38 views

Getting the name of content block

We can easily get the name of Impression Region using the %%_ImpressionRegionName%% Personalisation String. This works fine for Impression Regions defined with Ampscript or with Dynamic Content. ...
2
votes
0answers
208 views

Set GTL output in AMPSCRIPT variables

hope that someone can help me here: I'm trying to retrieve a simple result from a POST api call into ampscript variables. The cloudpage does show the variables as GTL, but when I try to display them ...
2
votes
0answers
78 views

Ampscript Not Working on Send SMS Journey Activity

I'm trying to create a journey to send a SMS with some personalization strings. The Journey is sending the SMS but all the ampscript variables come in empty, I'm using the following code: %%[ SET @...
2
votes
1answer
83 views

Could an AMPscript content block be affecting the format of the email in Gmail?

I have an email that uses a standard responsive Marketing Cloud template, which has an image block at the top, html content block in the middle (which is all AMPscript), followed by a social follow ...
2
votes
2answers
217 views

Sending and Retrieving AmpScript Values in Email strings for Microsites

We're using personalization strings in the url for the Unsubscribe links in our emails. The url links to our Preference Center microsite and includes certain values such as Job ID, List ID, MemberID, ...
2
votes
0answers
45 views

Triggered Email Send Sends Email Twice

I have a Cloudpage that takes a value, processes some logic and sends an email. Unfortunately, it sends two emails when it should send one. %%[ VAR @sfid, @contactId, @centre, @email, @subLanguage, @...
2
votes
0answers
117 views

Any possible way to set LINK ALIAS for regular Link Tracking (i.e., not Web Analytics Connector)

I've done my digging here, but can't get a solution. I'd like to set a LINK ALIAS via AMPscript, but I always see my AMPscript in Link Tracking (image attached). I tried CONCAT with no luck. I tried ...
2
votes
1answer
84 views

How to consume JSON data into data extensions when third party is sending JSON into marketing cloud

Can any one please help me how to implement this in marketing cloud. since i am new to marketing cloud and I know how we can do that in salesforce service/sales cloud. Scenario : we are digital ...
2
votes
0answers
221 views

Integration in Website / website personalization

As a webportal we are already using Marketing Cloud heavily for email/sms and push notifications. We are currently working on the personalization of our portal for registered customers. In the ...
2
votes
0answers
100 views

AMPScript Function UpdateSingleSalesforceObject Failure returning e500 instead of 0

I am working on a custom email preferences page and trying to handle a failure when AMPScript is attempting to update a salesforce record. The documentation states that failure will return a value of ...
2
votes
0answers
283 views

Marketing Cloud Ampscript Lookup variable

UPDATEI found the problem. - entrysource Journey = salesforce data event (which automatically creates 2 Example DataExtension with headers = service cloud fields) - from this journey I send the ...
2
votes
0answers
159 views

Unsubscribe SMS through Journey

We need to allow people to unsubscribe from an SMS that is sent through Journey Builder. We bring them to a Cloud Page where they confirm they want to unsubscribe. We also need to unsubscribe them ...
2
votes
0answers
45 views

Accessing Marketing Cloud 'Active Salesforce Sends' through SOAP API

Hi I need to get a feed of all scheduled sends within MC. This isn't an issue for most email sends. However, for any scheduled Salesforce Sends they don't appear in the SentEvent object. The below ...
2
votes
1answer
492 views

amp script to update a Contact Record in Salesforce

I have a backbone of code where I am passing subscriber key to a landing page from an email. I want that when a subscriber clicks and is redirected to the page to update 2 records in salesforce. I ...
2
votes
1answer
693 views

Custom CloudPage Preference Center

I'm trying to build a simple preference center using Smart Capture. I'm trying to have the user experience be when the person clicks the "Unsubscribe" CTA in the footer it sends them to a Landing Page ...
2
votes
2answers
157 views

Are there any 3rd party sources that provide a dynamic weather forecast I can embed in SFMC email?

I'm looking for an easy and affordable way to embed a dynamic weather forecast in an email campaign. Can anyone recommend a service or is there a way to do it with ampscript?
2
votes
1answer
268 views

AMPScript: How can use DecryptSymmetric() function to decrypt an encrypted string from PHP

I need to decrypt an encrypted string using AMPScript's DecryptSymmetric() function which is coming from an external system(PHP). I am not sure which algorithm PHP should use to encrypt the string, ...
2
votes
1answer
99 views

Ampscript isn't resolving

So I have an Email template with a small HTML part which contains an AMPScript snippet that references a plain HTML block. The problem I have is that in the sent email AMPScript isn't resolved. Am I ...
2
votes
0answers
183 views

What API Objects work with the InvokeExecute() AMPScript function?

The only example provided in the official documentation for the InvokeExecute() AMPScript function is for logging an unsubscribe event. I've only ever seen it used for that purpose. Do any of you ...
2
votes
0answers
283 views

Ampscript Loop : Multiple rows needed in multi-column email layout

My newsletter was set up to loop per row in the DE to fill in needed info into a content block that gets created up to 35 times. There has been a new content block that now requires I pull two or more ...
2
votes
2answers
3k views

AMPscript Lookup function

%%[ VAR @EventType, @DateTime, @Address SET @EventType = Lookup("CampaignMember_Contact_Builder", "Event_Type__c", "ContactId", _subscriberkey) SET @DateTime = Lookup("CampaignMember_Contact_Builder", ...
2
votes
0answers
130 views

XSLT error using TransformXML Function

Here I am using TransformXML to parse xml to an email. I have saved xsl stylesheet as a content block and used the above function to parse xml to the email. When the email is previewed using the xml ...
2
votes
1answer
275 views

GTL in a Content Area

I'm using GTL (Guide Template Language) on the body of an email where I want to show some images dynamically and works well. But, to let the email more "clean" I want to copy that GTL code on a ...
2
votes
1answer
466 views

AMPScript, Checking values in a row

Please forgive my beginner level understanding here, I've been thrust into modifying an email that hasn't been touched in a few years, and I've never used AMPScript before. I'll try to keep this ...
2
votes
1answer
114 views

Verifying that an existing contact in Salescloud can subscribe again (update) via a subscription cloud page - AMPscript

I want to check if a contact already exists in Sales Cloud, when subscribing via a Cloud Page. If so, the contact needs to be updated. If not, I want a new lead to be created. I keep getting a HTTP ...