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.

Filter by
Sorted by
Tagged with
18
votes
4answers
8k views

Can AMPScript parse JSON?

Using AMPScript to parse an XML feed. Client is switching to JSON. Is there something similar to BuildrowsetfromXML() for JSON in AMPScript? I am confined to using the members login area and not an ...
11
votes
3answers
3k views

How to use HTTPGet variable in URL (ExactTarget)?

Been trying to figure out a way to pass in the variable into a HTTPGet function for long time now. How to do it? Here's what I have so far, but it doesn't return anything. <p id="date" style="...
11
votes
5answers
3k views

Using AMPscript to retrieve content from CloudPages

We've build a CloudPage that looks like this: <!doctype html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body>hello world</body&...
10
votes
1answer
239 views

What are the extra arguments in InvokePerform() AMPScript function?

There are no examples on the usage of the InvokePerform() AMPScript function in the official documentation -- at least that I can find. Doing some testing and comparing the usage to the SOAP API, I ...
9
votes
4answers
2k views

How to get the floor (round down instead of up) of a number with AMPscript?

I'm doing a bit of math with AMPscript, and I'd like to be able to round a number DOWN eg: I would like 5.5, 5.6, 5.7 etc.. to become 5, not 6 The standard FormatNumber() function will automatically ...
9
votes
1answer
232 views

Using AMPscript/SSJS how do you unsubscribe a subscriber from a child business unit?

My goal is to create a page that passes a business unit id and a subscriber key. The page sits on the parent/enterprise business unit, it will receive business unit ids from a child business unit. ...
9
votes
1answer
354 views

Handing REST API POST Exceptions using SSJS Try-Catch on a Landing Page Form Submission with AMPSCRIPT

I have an issue with a landing page containing a webform that submits input from the user and using AMPSCRIPT I make a Rest API call using the HTTPPost2 function to utilize the validateEmail resource. ...
7
votes
2answers
1k views

How to determine if a number is even or odd with AMPScript?

I have a global variable called @Count. I also have a for loop that increases the @Count by 1 each time I cycle through the loop. Is there a way for me to detect with AMPScript whether @Count is an ...
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 ...
6
votes
2answers
8k views

Dynamic sender profile with AmpScript

My Client is sending to 40 different countries a unique, localized and highly personalized email. They want to have a different sender profile depending on the contact country code, including a ...
6
votes
2answers
7k views

How To Display Values from a Data Extension with AMPScript

OK. So I have read all of the documentation, and tried this on my own, but this is all still coming up Japanese to me. I need help writing the code I need to bring data in from an extension to create ...
6
votes
1answer
3k views

AmpScript to select Right or Left characters from a string

Is there an AmpScript function that can be used in an equivalent manner to sql left, right and mid functions? Thanks, Mark
6
votes
2answers
2k views

Retrieve subscriber status from a business unit with ampscript

I want to get the business unit level subscriber status of a subscriber from a landing page within that business unit. My first thought was a retrieve request on the subscriber by subscriber key but I ...
5
votes
2answers
2k views

Difference between Amp script or ssjs

what is the main difference between amp script or ssjs in marketing cloud. Can you please give me clear information for amp script or ssjs difference.
5
votes
1answer
70 views

How to handle umlaute/mutations in AMP Script with REST API?

we are using AMPscript to transfer/send parts of our mailings we send through Email Studio (not Salesforce) to our REST service via HTTPPost to make the information available in an external CRM that ...
5
votes
1answer
4k views

View as Webpage custom setup for retrieval not working as expected

We recently added view as webpage URLs to our send logging data extension in order to show that url in another email. Article for reference: https://code.exacttarget.com/question/rebuild-view-web-...
5
votes
1answer
106 views

Why does UpsertDe fail with Subscriber ID?

I have an odd bug that I am running into. I will try to explain what we are seeing as best as possible without writing a novel! What we are trying to do is run a bit of AMPscript to add/update a ...
5
votes
1answer
912 views

How to add Attributes to a TriggeredSendDefinition on LandingPage

I am creating a landing page with a form. On submit, the form passes variables to another landing page that will process and perform three different tasks, two of which are performing a TriggeredSend ...
5
votes
1answer
346 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
234 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
2answers
4k views

Using AMPscript with SSJS Activities

I have tried using the below AMPscript block in an SSJS Activity, however it appears that Script activities only support SSJS and AMPscript cannot be included in Script Activities — please can someone ...
4
votes
2answers
13k views

Marketing Cloud Landing Page: pass values to a data extension

I created a landing page which auto-populates first name, last name and the email. Now I need to pass these 3 along with what radio buttons are selected by the user to a data extension other than the ...
4
votes
2answers
4k views

REST API Methods in AMPScript or SSJS

Is there any way via AMPScript or SSJS to utilize HTTP methods outside of GET and POST? I have had no problem utilizing these two via the HTTPPost() and HTTPGet() functions, but have not found any ...
4
votes
3answers
4k views

Exact Target Data Extension and special characters - HTML markup

We have text fields and areas displayed within our Exact Target Landing Pages which had been inserted into a Data Extension text field using AMPscript enabled landing pages. We are using the "pre" tag ...
4
votes
3answers
1k views

Loop Support in AMPscript

I'm very comfortable with using for loops in AMPscript. However, someone recently mentioned that other loop contexts are supported, similar to JavaScript, which offers: for - loops through a block of ...
4
votes
1answer
3k views

AMPscript - If Contains

In an AMPscript If statement, is there a way to use "contains" as the operator? For example: If Var1 Contains "Dog" Then do this Would I just have to use a regular Expression? Thanks, Ben
4
votes
2answers
501 views

UpdateSingleSalesforceObject - Error in the application

I am trying to save the send date in a Sales Cloud field with this expression: %%[SET @Lead_Id="00Q3100000Z3HIcAAN", SET @result = UpdateSingleSalesforceObject('Lead',@Lead_Id,'...
4
votes
2answers
1k views

Can you 'break' a for loop in AmpScript?

I would like to know if its possible to break a FOR loop in AmpScript. I am traversing through a rowset and would like to stop on the first match. SET @BookingRowset = LookupOrderedRows("bookings", ...
4
votes
1answer
374 views

how can we display only the timezone in AMPscript

how can we display only the timezone in AMPscript using now(). I tried using %%=Format(Now(),'zzzz')=%% but its not displaying the timeZone instead it's displaying -06:00.
4
votes
3answers
2k views

How can one retreive the business unit level subscription status from within the business unit?

I'm building an Ampscript-based preference center in a microsite inside a business unit on an enterprise 2 account. I can easily update my subscribers but I cannot seem to find a way to find the ...
4
votes
2answers
1k views

RaiseError - Will it stop email from sending

I have an email that is pulling in a content area. In that content area it doing a lookup on a data extension. The data extension should have data for that subscriber in it but in some rare cases (...
4
votes
1answer
666 views

HTML editor error in content builder

We're transitioning all our old email code from the Classic Content into the Content Builder, but I've run into an issue several times that looks like a glitch in the HTML editor (NOT the wysiwyg) to ...
4
votes
1answer
1k views

Accessing the contents of My Contents folder using AMPScript

I need to populate a dropdown menu with a list of the items in the My Contents folder In the ExactTarget Marketing Cloud using AMPSCripts and have not had any luck. I was able to do this for the ...
4
votes
1answer
2k views

How can I make sure the exacttarget email I've built using ampscript only sends if there are new posts in my RSS feed?

I've created an email using ampscript that pulls in the latest blog posts from an RSS feed. I would like to automate the sending of this email on a daily basis. This blog may have days where there is ...
4
votes
2answers
249 views

Using AMPScript to pull in RSS feed content in SFMC

I am attempting to pull in content from a blog feed using AMPscript but am experiencing some issues in attempt to do so. It is probably worth noting that all I need to pull in is the title, ...
4
votes
1answer
195 views

How to translate the cloud pages based on the browser language in salesforce marketing cloud

I have been working in custom preference centre and one of the requirement is to translate the page based on the browser language. The difficulty here is detecting the browser language "Navigator....
4
votes
1answer
341 views

Web Analytics Connector and LinkName

I've recently setup Web Analytic Connector (WAC). I'm now trying to customize the WAC string to return a static value in the utm_contact parameter when no link alias is assigned. By default this ...
4
votes
1answer
600 views

Using Exclusion Script with _Sent Data View

I would like to use an Exclusion Script when sending an email from Content Builder where if the Subscriber has received an email in the past week, then the email should be suppressed from sending. ...
4
votes
1answer
232 views

Displaying a variable before it has been set to a value

What I have is an app that pulls in social media and displays that content in ExactTarget. I want to set text and links in the email based upon the content in the social post... in this case WordPress....
4
votes
1answer
914 views

Issue parsing RSS feed in Exacttarget ampscript

I've got an email that uses the following to parse an RSS feed and print the last 5 blog posts. Now they want to print all blog posts from the past week. Any help? %%[Var @xml, @titles, @title, @...
4
votes
1answer
207 views

Data Extension 101

Been trying (without success) to insert a row of custom data into an email triggered out of SFDC that picks up a DE from Exact Target. Read lots and lots of documentation and tested many hours but ...
4
votes
1answer
77 views

Journey builder email send activity exclusion script issue

I am trying to use an exclusion script in an email send activity to inject data to a data extension. I have no intention of sending the email. I have tried with both upsertDE() (the email send ...
4
votes
1answer
211 views

Can my Custom Block output SSJS in into a block in Content Builder?

I'm creating a custom content block by extending content builder as described here: https://developer.salesforce.com/docs/atlas.en-us.mc-app-development.meta/mc-app-development/content-sdk.htm I'm ...
4
votes
2answers
2k views

Decrypt a string encrypted by the EncryptSymmetric() AMPscript function using PHP

I read elsewhere in StackExchange that it's not possible to decrypt AES strings originating from AMPScript in PHP. Is this true? It seems that it should be possible with mcrypt. Also, part two for ...
4
votes
1answer
1k views

Exacttarget AMP data extension Querying for Not empty values

I would like to query the Data extension record - subscriber with phone field contains data and aswell phone field not containing data . VAR @Rows2, SET @Rows2 = LOOKUPROWS("dataextensionREcord","...
4
votes
0answers
48 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
153 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 '...