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.

797 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
0 answers
511 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 ...
Adam Spriggs's user avatar
  • 30.6k
5 votes
1 answer
11k 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 ...
DigitalMC's user avatar
  • 313
4 votes
0 answers
1k views

Pausing Records in Journey Over Weekend

I'm looking to build a journey that sends a few emails only during the weekdays and then on Monday would send to anyone that was at that point over the weekend. As an example, a record downloads a ...
RunRabbit's user avatar
4 votes
0 answers
282 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 ...
AndrewC's user avatar
  • 301
4 votes
0 answers
82 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 ...
ShonG's user avatar
  • 71
4 votes
0 answers
578 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 '...
Brian M's user avatar
  • 41
3 votes
1 answer
587 views

Distributed Marketing displays error during email preview

We have built a email for distributed marketing. The email will preform a lookup on a Stored DE to dynamically display the store address associated with the send. This is accomplished by taking the ...
David Devoy's user avatar
  • 2,615
3 votes
0 answers
312 views

Dynamic MobilePush Content using ContactKey in Ampscript

Need to get the contact key of a person who entered a location (using location based push message) and retrieve firstname from a different data extension. Since there is no Data extension used here, (...
SFMC Guru's user avatar
3 votes
0 answers
25 views

How to return values from the same field across multiple Quote Lines

Hope you're all having a really great day! In a recent build, I was tasked with printing a warning message when a subscriber's quote includes a mobile transfer (Mobile_Transfer__c = true). In testing ...
Benjamin Penketh's user avatar
3 votes
0 answers
461 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 ...
Jackson Chen's user avatar
  • 4,695
3 votes
1 answer
227 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 ...
TCassa's user avatar
  • 878
3 votes
0 answers
373 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 ...
Jonas Lamberty's user avatar
3 votes
1 answer
874 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 ...
varun's user avatar
  • 43
3 votes
0 answers
406 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" ...
Mike Marks's user avatar
3 votes
0 answers
341 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 ...
Daniel's user avatar
  • 105
3 votes
0 answers
109 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 ...
Stan Alachniewicz's user avatar
3 votes
0 answers
1k 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 ...
ncv's user avatar
  • 418
3 votes
0 answers
814 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 ...
Kenneth Wagner's user avatar
3 votes
0 answers
873 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, ...
Ellen's user avatar
  • 31
3 votes
1 answer
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 ...
Pravin's user avatar
  • 395
2 votes
0 answers
181 views

How to target a specific device in case a user has multiple devices (Push Notification)

I need to understand how to target a specific device in case a user has multiple devices via a push notification activity (journey builder). I found this official SF article Link Where they mention: &...
Juraj Reško's user avatar
2 votes
0 answers
330 views

How to manage automation via ampscript API - second part

I would like to close the discussion thread on this related topic Manage automation via ampscript API. If you have additional information to complement it would be great to hear on the answers! Here ...
Ivan Santana's user avatar
2 votes
0 answers
86 views

CreateSalesforceObject in AMPscript wrong caseid assignment on my survey custom object

I'm sending interactive email support service surveys via marketing cloud and saving the results of SurveyParticipant(contactid) SurveySubject(caseid) CSAT NPS... in a data extension. I also want to ...
Miguel's user avatar
  • 21
2 votes
0 answers
240 views

Trying to make API call to external server from SFMC

I'm trying to make API call to external system from a Cloud page, but when I publish I'm getting response Response:nullresultString. Is it something do with IP whitelisting or it's a code error. Below ...
Ramya's user avatar
  • 31
2 votes
0 answers
133 views

Accessing Journey Data (Salesforce Activity output) in Email

In JB I've used Object Activity to create a SF object. This activity produce a SF object ID as output, I can use this output in other shapes using: {{Interaction.SALESCLOUDACTIVITY-1....
Vale1501's user avatar
2 votes
0 answers
202 views

Marketing Cloud Barcodes

I've got the following code generating a barcode: %%[ set @BarcodeURL = BarCodeURL(@Barcode, "Code128Auto", 100, 50)]%% <p><img src="%%=v(@BarcodeURL)=%%"></p> ...
John Green's user avatar
2 votes
0 answers
390 views

Have to Track the Campaign ID and Description using DataViews

Currently, I'm tracking the email sent details using data views and storing in a DE, I need to track campaign ID and Description in the same DE. Is there a way to track it using Data Views? In my ...
kiran's user avatar
  • 47
2 votes
0 answers
284 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 ...
Harish 's user avatar
  • 111
2 votes
0 answers
721 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 ...
Lukkinator's user avatar
2 votes
1 answer
626 views

How can 'RaiseError' and 'InsertDE' AMPscript functions be used to catch ANY error in a Triggered Send?

We currently have a Triggered Send Definition that is encountering errors occasionally and preventing further emails from sending. Marketing Cloud support has been able to provide some error messages, ...
Holland Dotts's user avatar
2 votes
0 answers
453 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 ...
Enrique Diaz's user avatar
2 votes
0 answers
1k 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) ]%% ...
Adam Spriggs's user avatar
  • 30.6k
2 votes
0 answers
406 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. ...
Lukas Lunow's user avatar
  • 21.4k
2 votes
0 answers
191 views

Resubscribing at multiple business unit level

I am working at a code for a resubscribe for a custom unsubscribe centre that will update the Active Status back in Marketing Cloud & also updates a custom object in Salesforce; the update in ...
Wallace's user avatar
  • 341
2 votes
1 answer
1k 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 ...
Louis's user avatar
  • 21
2 votes
0 answers
192 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 @...
JMedeiros's user avatar
2 votes
0 answers
174 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, @...
neo2049's user avatar
  • 392
2 votes
0 answers
353 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 ...
George Rosedale's user avatar
2 votes
0 answers
428 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 ...
Nico E's user avatar
  • 21
2 votes
0 answers
261 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 ...
Yosef Sahler's user avatar
2 votes
0 answers
802 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 ...
J.Nie's user avatar
  • 31
2 votes
0 answers
818 views

Platform.Request.GetPostData() won't parse to json object

SSJS Landing Page access POST JSON Request payload Based on this thread. I have form that is generated by the contents of several data extensions. The contents in these are meant to be editable, so ...
Matt Goldstein's user avatar
2 votes
1 answer
2k 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. ...
Wallace's user avatar
  • 341
2 votes
1 answer
1k 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 ...
Jerome Stontz's user avatar
2 votes
2 answers
375 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?
absolutchele's user avatar
2 votes
0 answers
1k 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 ...
user36778's user avatar
  • 646
2 votes
1 answer
469 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 ...
Javier García Manzano's user avatar
2 votes
0 answers
258 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 ...
Adam Spriggs's user avatar
  • 30.6k
2 votes
1 answer
505 views

Remove campaign member from Salesforce in AMPscript

Is it possible to remove a campaign member from particular campaign using AMPscript? As far as I know there's no function like "DeleteSalesforceObject" (in contrary to CreateSalesforceObject). I'd ...
Kitka92's user avatar
  • 145
2 votes
0 answers
670 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 ...
FreeDaGeek's user avatar

1
2 3 4 5
16