Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [ampscript]

AMPscript is a 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.

0
votes
2answers
31 views

Row Count error

I wrote a code that reads that xml data and extracts all the values, separate the First Name from the Last Name and updates the DE, but I am still getting an error: "Invalid index (parameter 2) ...
0
votes
1answer
24 views

Figuring out hand me down promo code ampscript

I am very new to ampscripting and I have inherited an ampscript for pulling promo code that was written by the previously developer that I couldn't make sense of. Here's the ampscript in question: %%[...
0
votes
1answer
37 views

UpdateData function in Cloud Pages

I was trying to update a data extension with suscriber data about interests, I recently added 2 new rows, as this is filled with records from a register form, I'm planning to send an email with a ...
-4
votes
0answers
24 views

Landing Page taking Data from DE [on hold]

I have created DE with fields Name Email City. I wants to send a landings page but the landing page should automatically take city of the subscribers from DE
1
vote
0answers
37 views

Update DE using data from BuildRowsetFromXml

I have an xml export that I need to use in order to send email to the users from the xml, to separate the ContactName in to FirstName and LastNameand and also to update a DE. The content of the xml is ...
0
votes
0answers
26 views

How to send Subscribers Key in the Cloud Page Url to Fetch / Auto Populate the Subscriber's data [duplicate]

My requirement : I want a custom profile center where in the user if click on the footer link it sends him to a page with his auto populated attribute like First Name , Last Name and the publications ...
2
votes
1answer
41 views

Error when Retrieving Salesforce Account Fields

I'm trying to retrieve some fields from the Account object in a Salesforce org connected by the MC Connector in order to eventually pre-populate a preference page. This is the AMPscript I'm using but ...
-1
votes
0answers
16 views

Passing data from smartcapture fields to the url on form submit [on hold]

I want to pass email from Smart Capture to the URL on form submission. I have a landing page with a Smart Capture and I want to pass the email address to the other landing page after submission to ...
0
votes
1answer
43 views

Substring and UpsertDE

I am trying to update my Data Extension;s FirstName and LastName columns based on the values resulting from substring. If I test the email without UpsertDE it works, if I add the UpserdDE function it ...
0
votes
2answers
37 views

How to display Date (Format 'DD/MM/YYYY') in a single input type textbox in cloudpage

I'm trying to display a Date in a single input type textbox in Cloudpage, the data will be coming from Data Extension. I tried changing the type to date : <input type="date" name="...
0
votes
1answer
25 views

Updatesinglesalesforceobject from child business unit

I need to update a sf contacts preferences from a preference center page that lives in the child business unit. I thought I could pass variables through to a processing page via form submit ...
0
votes
1answer
36 views

URL parameters not working on Cloudpages

I'm using some ampscript to set a variable to pull record information in from a Data Extension based on their contactKey. I've done this several times before (different marketing cloud instance). /* ...
0
votes
1answer
26 views

AmpScript Rss Feed

Im trying to pull RSS feed into my email. I want to pull in the <content:encoded> as the full description and the image. I added "Set @xml = Replace(@xml1,'content:encoded','contentencoded')". I ...
1
vote
1answer
35 views

Ampscript fallback content for country Canada

I have a code in the header which is supposed to give you a fall back content block if the country isn't any of those listed, in this case Canada which has French and English as language. In the ...
0
votes
2answers
67 views

Loading content block using AMPScript based on specific date of the year

We have a journey setup in Marketing Cloud based on a application of a store card. We want to add in a dynamic contact block for holidays indicating processing time will take longer during this period....
1
vote
0answers
30 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 ...
0
votes
1answer
46 views

Load HTML template block using AMPscript

I've created the one HTML content whose type is 'template' and now I'm trying to call that content using the AMPscrip function '%%=ContentBlockbyId("384201")=%%' in blank email template but it gives ...
0
votes
1answer
42 views

Update Salesforce Object using CampaignMember:Id as variable from Journey

I'm trying to use the CampaignMember:Id as a variable to update the Campaign Member Status when an email is sent. I've tried this AMPscript but receive the following error: "Script SET Statement ...
0
votes
1answer
55 views

Custom Form information into a data extension [closed]

Is it possible to have a custom form write the results into a data extension? The form will have a Name field, an Event Type (dropdown), and a Promotion Type (Checkbox). I have a data extension setup ...
0
votes
1answer
29 views

Ampscript function to remove the comma from a number greater than 1000

I have an API call that is passing over what should be a number as a text field. If the number is over 1000, the value is being sent with a comma (e.g. 3,000 instead of 3000). Salesforce will not ...
0
votes
2answers
56 views

Passing SubscriberKey in the SCRIPT tag

I have a Cloud page where I am invoking a code resource (using below script tag) which has all my AMPScript written - <script type="text/javascript"src="http://cloud.homes.xyz.email/...
3
votes
1answer
66 views

How to use BuildRowSetFromXML with an “attribute-id” in SFMC?

I'm having trouble referencing a specific item in our order XML feed. I want to reference a specific "attribute-id", not the entire rowset. XML reference: <custom-attributes> <...
0
votes
2answers
35 views

AMPscript formatting a number using a variable that needs TreatAsContent

I have a data extension that gives me a user's currency, plus fields for the cost that look like this: cost_USD | cost_EUR | cost_BRL Here's what I have in my ampscript: Set @partner_currency = ...
0
votes
1answer
36 views

AMPscript code for showing nothing if the condition was not met

I would like to display an HTML block to a subscriber based on his customer_type status, using an IF statement. However, not all subscribers have the above field filled (there are some with NULL ...
0
votes
2answers
72 views

Unsubscribe an user from publication list using ampscript in Marketing Cloud

Hi I am trying create a custom unsubscribe page to unsubscribe from a publication list. Below is the code: %%[ VAR @email, @err, @clientID SET @MID = "64*****" SET @clientID = CreateObject("...
0
votes
2answers
80 views

JSON call using SSJS to populate a dropdown list in HTML and pass it through using AMP

I have a JSON object full of County names and I want to call it using SSJS then populate a dropdown list in HTML using the Data from the JSON. JSON looks like this [ "AZ - Maricopa", "AZ - ...
1
vote
1answer
41 views

Did anyone tried to use ClaimRow() for one-time send to a large number of target audiences?

I have developed an AMPScript block that uses the ClaimRow() function and it is working very smoothly when we send emails via Journey Builder. But now, we aim to send an Ad-hoc email to a large number ...
1
vote
1answer
62 views

Use lookup value within concat function

I am having some difficulty producing a string where I am attempting to use a lookup value within a concat function. Below is the code I am trying to execute. - Any assistance here would be greatly ...
0
votes
1answer
57 views

AMPscript Lookup Function Error

I need to populate an HREF by looking up a value in a data extension. Here's what I'm using as the email AMPscript to generate the HREF URL: %%[ Var @LINK_VALUE, @EMAIL_ADDRESS, @BASE, @...
2
votes
0answers
49 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 ...
3
votes
2answers
134 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, ...
0
votes
1answer
30 views

How do you order by multiple columns using AMPScript LookupOrderedRows?

Using the LookupOrderedRows function is it possible to list multiple columns? If not, how have people approached this?
0
votes
1answer
31 views

AMPscript to count all rows

I would like to count all rows in a Data Extension in Marketing Cloud. The only way I have seen is using LookupRows which has a max of 2000 rows. I just want to know how many rows, there is no need ...
1
vote
0answers
39 views

Insert a delay of a few seconds in SSJS script after a function call

Use case: Send emails based on personlization data of a few records using SSJS script. I have an email that will pull personlization data of off a non sendable Data Extension. The email will pull the ...
0
votes
1answer
51 views

Passing SubscriberKey from CloudPage to JavaScript file

I have a custom preference center built in CloudPages. Also have a separate code resource file (RetrieveMemberdata.js) which contains all my AMPScript. This file is invoked from CloudPage using tag ...
0
votes
2answers
50 views

How to report on the performance of dynamic subject lines?

I have dynamic subject lines being pulled in from a Data Extension. I then have a code snippet content block that has a set of if statements which determine what row/subject line the recipient should ...
0
votes
1answer
37 views

Parsing Ampscript from a data extension row

I have a data extension with a 'subjectline' column with the content '%%FirstName%%, check out this great subject line'. I then have a code snippet content block that has a set of if statements which ...
0
votes
1answer
41 views

Clearing data out of a list

We have an email validation process that checks a list ID for an email in order to validate if that person has already signed up. Currently the only way I know to automatically populate that list is: ...
1
vote
0answers
40 views

GET XML via AMPScript

We are currently in the process of trying to get XML data in our marketing cloud emails. One of the solutions i am working on is trying to get the XML via amp script then populate the information via ...
1
vote
1answer
35 views

BuildRowsetFromXML with a clause

We are currently in the process of trying to bring CMS content in our marketing cloud emails. I have ran in a bit of an issue when I am trying to bring in the pictures. In a stripped down example of ...
0
votes
2answers
36 views

Reply Mail Management - Custom Email Body

I am trying to insert the code %%=ContentBlockbyId("370")=%% on my RMM body, but when I got the RMM message SFMC it isn't translated the AMPScript and I am receiving an email with the message %%=...
0
votes
1answer
28 views

AMPscript not woring in email body

This maybe a silly question as i am totally unknown to the AMPscript. I am trying to get date in the email body so wrote the following code, but when sent out test emails, the code was not replaced ...
0
votes
1answer
23 views

API to Triggered Send is “OK” but email fails in AMPscript — can we use API to pull the error record?

we've set up triggered sends, and it works just fine... however, on occasion the BuildRowSetfromString fails because the delimiter is missing (for example, there are 3 products in the email, but only ...
0
votes
1answer
54 views

Populate data extension according Checkbox in Cloudpage

I tried to create a cloudpage in html that has a checkbox with three subjects that the customer will mark if has interest. This is my cloudpage: https://pub.s7.exacttarget.com/u2qn0g1i5kd I used ...
1
vote
2answers
51 views

SFMC Cloudpage Execution Context is always load

I am making a cloud page to be a subscription centre. When the page is requested with a GET I want the user to submit a form on the page. When the page is requested with a POST, I want to unsubscribe ...
0
votes
1answer
53 views

!= strangeness, not working despite the values being the same

If I do the following set @currentOutlet= 1 set @previousOutlet= 0 if @email_rowCount != 0 then for @i = 1 to @email_rowCount do set @this_row = row(@email_rows,@i) /*get row based on loop ...
1
vote
2answers
45 views

content builder editing AMPscript

I'm trying to use AMPscript in Content Builder and am getting a lot of HTML being added to the code. For example : %%[ var @a,@b,@c set @a = 1 ]%% Generates an error because a <br /> is added ...
3
votes
1answer
74 views

How to resubscribe a subscriber in mobile connect

We have a use case where we want to house all unsubscribed in Salesforce CRM but not in Marketing Cloud. This works in email sends as I can always send the transactional emails from Marketing Cloud , ...
1
vote
1answer
24 views

AMPscript CONCAT using a variable

I am working on a script that will display content based on subscriber's local value from Sales Cloud. Everything works fine until the Concat function, where I am trying to include a variable, but it ...
0
votes
1answer
42 views

Ampscript IF OR statement for salutation rule

I'm stuck with my language variables, maybe someone can have a look and help? The code worked until I noticed that I have not one field to take into consideration (title) but the info might be in ...