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.

547 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
272 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 ...
6
votes
2answers
291 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 ...
5
votes
1answer
243 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 ...
5
votes
1answer
5k 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
520 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
77 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
118 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
0answers
102 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 ...
3
votes
0answers
160 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
0answers
54 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 ...
3
votes
1answer
250 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
97 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
510 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
377 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
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
669 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
2k views

Triggered Send using REST API with Data Extension

I would like to substitute some variables in my email template using SFMC's REST API. For example, in my email: %%[Substitute_var1]%% When I call it through REST, how it's possible to substitute ...
2
votes
0answers
44 views

Unable to update Publication List in parent BU

We have developed a cloud page to update publication list to update status from Active to Unsubscribe or Unsubscribe to Active. If someone select the check box and click submit. This works fine in ...
2
votes
0answers
87 views

link tracking with httpgetwrap and TreatAsContent

I hope you guys are able to help me with my issue. I have been working on making our mailings a bit more dynamic. Technically it works as desired, however I noticed that the links are not being ...
2
votes
1answer
116 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
56 views

Assign using Active Assignment Rule being ignored with UpdateSingleSalesforceObject

The AMPscript function UpdateSingleSalesforceObject ignores Assignment Rules when Leads are created or updated. Is there any way to assign the assignment rule when a lead is updated via ...
2
votes
0answers
31 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
224 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
61 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
351 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
99 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
2answers
427 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
50 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
162 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
150 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
262 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
136 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
420 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
178 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
1answer
719 views

AMPscript to update a Contact Record in Salesforce

I have a backbone of code where I am passing the 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. ...
2
votes
1answer
854 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
173 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
342 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
137 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
193 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
323 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
4k 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
140 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
0answers
524 views

Apex Encryption to AMPscript Decryption

I receive a string encrypted using the Apex function Crypto.encryptWithManagedIV() using AES256 as a url parameter, and I need to be able to decrypt this string on a marketing cloud landing page. I ...
2
votes
1answer
300 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
532 views

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
120 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 ...
2
votes
0answers
969 views

CreateSalesforceObject AMPscript function and Record Locking Concurrency

We are using the CreateSalesforceObject AMPscript function to create a new record in the Salesforce CampaignMember Object when an email is sent, by including the following code in an email: set @...
2
votes
0answers
88 views

Can socialslots use variables?

When using social forwards in an RSS feed email, can socialslots be used for each item in the feed (so instead of literally naming an area, can variables be used)? <!-- RegionStart[ socialslot:"...
2
votes
0answers
671 views

ExactTarget: URL in a variable - not tracked

I believe I've come across a bug. I wondered if anyone else have come up with a solution for this? %%[ set @bodycopy = "Visit the all new whatever I'm talking about. <a href=""...

1
2 3 4 5
11