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
0 votes
1 answer
29 views

Using AMPScript to dynamically display email messages

Apologies if I'm not explaining this very well but I am pretty new to AMPScript. So what I'm trying to achieve is basically dynamic content. If a person's course in the data extension matches what I ...
user avatar
  • 1
0 votes
0 answers
25 views

Gather email feedback in a Data extension [closed]

we are trying to build a logic where at the end of each email, there is a HTML block with either a thumbs up or a thumbs down icon to measure email sentiment. Each thumb will need to lead to a cloud ...
user avatar
0 votes
1 answer
34 views

SFMC - Preview Email Link (not view_email_url)

I've created some ampscript which will create a Note on the contacts account to let the account owner know this account has been sent an email. Inside the note contains the view_email_url so the ...
user avatar
0 votes
1 answer
48 views

Ampscript error - unsure how to troubleshoot

Getting this error: 'A variable name is not a valid because contains illegal characters. Variable names must begin with the @ symbol followed by one or more letters, numbers, or underscores. Variable ...
user avatar
0 votes
1 answer
23 views

How to wrap ampscript with loops on the table

I have an ampscript code and using loops to fetch the data, I'm trying to wrap my table header, when the city list is empty, then, it would only show: No rows found. However, the header table still ...
user avatar
  • 5
0 votes
1 answer
28 views

Ampscript if else statement issue

I have an issue to understand the else if statement, so basically if city is empty I want it to show: no rows found, I tried to add: %%[ if @rowCount > 1, from my understanding if there's city, ...
user avatar
  • 5
0 votes
1 answer
21 views

AMP script error with conditional statement "The initial end count value for the for loop could not be cast to an integer."

I'm getting the error The subscriber preview failed to generate. Review the details, correct all issues, and try again. The initial end count value for the for loop could not be cast to an integer. ...
user avatar
-2 votes
1 answer
28 views

Can we use RedirectTo() functions to call the contentblock in marketing cloud

We have a requirement - when we click on a button, it should redirect to particular contentblock. I have tried multiple ways like <a href="%%=ContentBlockByKey(@contentBlockKey)=%%">...
user avatar
  • 35
0 votes
0 answers
23 views

How to apply css to the email template in marketing cloud?

I have created emails from email templates available in the marketing cloud. To add CSS to an email I have used HTML content block and added CSS inside the <style> [CSS here] </style>tag. ...
user avatar
  • 1
-1 votes
0 answers
20 views

Cloudpage Form Data Validation Using 2 Variables [closed]

I have a lead list containing columns with data for a promo code and a unique code, both of which are unique per customer. I've built a landing page with an HTML form asking for these details. When ...
user avatar
0 votes
0 answers
34 views

Personalization error: %%policy_number%%

Personalization error: %%policy_number%% To fix the problem, please try the following: - Make sure that there is not a space or typo within the personalization string in your email. For example, check ...
user avatar
0 votes
0 answers
13 views

AMP Script issue, display loop separated by comma instead of rows

You may find my code below which works fine for row-separated values but does not work when the values are comma-separated in a single row. I will use it to display all products the customer has ...
user avatar
0 votes
0 answers
13 views

How can I write AMPscript for Multiple publications lists were selected to loop through them assigning the publication list Id for each publication? [closed]

%%[ VAR @pageURL, @sfContactID, @email, @pageID, @subscriptionURL set @subkey = Trim(Lowercase(RequestParameter("e"))) SET @sfContactID = Trim(RequestParameter("b")) ...
user avatar
0 votes
0 answers
37 views

Order Confirmation email must populate Country Currency locale via ampscript but does not work (formatcurrency)

When an order occurs on the website, Marketing cloud holds the country locale of en_US and en_CA in a Data Extension field titled "locale" The following ampscript is not pulling in the ...
user avatar
  • 1
1 vote
0 answers
18 views

Email triggered send job stopped by AMPscript Decode function issue

I'm struggling a lot and not even support is being able to help me with this, hope that you can, and read any idea. I got an email with 8 different SKUs populating each one from two DEs. The code didn'...
user avatar
0 votes
1 answer
27 views

Broken URL, that was insertet per Lookup

Hello I have the following Problem: I am using AMPScript in order to retrieve a picture, saved as an URL link in a data extension. However, some of the URLs are broken (unknown reason) and i want to ...
user avatar
  • 1
0 votes
0 answers
22 views

Conditional Display of content on Cloudpage in Marketing Cloud

Marketing Cloud Query I am trying to display content through a cloud page with a condition. Use Case - If the subscriber is Active , Display Unsub Page Else Display Resub Page. The pages are content ...
user avatar
1 vote
1 answer
60 views

RSS feed in Marketing Cloud email is not populating, potentially because of special characters in the XML content

I am trying to create a simple email that has an RSS feed pulled into it, using this site as a guide: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/rssFeedEmail.html. I have ...
user avatar
  • 13
-1 votes
0 answers
19 views

Unsuscribe link disappear in web browser view

I'm trying to fix a problem with the unsubscribe link disappearing in the web version of my email (and not the email himself). This unsubscribe link (set in AMP Script) is conditioned in the case ...
user avatar
0 votes
0 answers
22 views

Validate duplicate entry in data extension and display error if duplicate other wise Insert into DE using smart Capture form

I want functionality in the smart Capture form in which if the user enters a duplicate entry for the same primary key then the page must display error in the same smart Capture otherwise the record ...
user avatar
  • 1
6 votes
3 answers
339 views

How to improve email delivery speed for highly dynamic email (fetching product info)

We're looking to improve the send time of a recurrent email campaign. The campaign has for objective to push a given number of products in an e-mail (max 20 products). The email contains quite some ...
user avatar
2 votes
0 answers
38 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 ...
user avatar
0 votes
1 answer
36 views

How does SystemDateToLocalDate work in Cloud pages?

I am aware that the function SystemDateToLocalDate function, Converts a system datetime string or object to the user's local time. Which is answered here How does SystemDatetoLocalDate work in ET? ...
user avatar
0 votes
0 answers
40 views

How to read my xml in a link using ampscript

I have my xml in a link and I would like to parse ampscript, how could I read the XML in my ampscript? XML - <?xml version="1.0" encoding="UTF-8"?> <cart> <...
user avatar
0 votes
1 answer
35 views

Retrieve Person Account Details through Ampscript

I would like to fetch the field data in my email template from Service cloud person account. There is no syntax error, however it's not returning any values. I also tried with Contact object in '...
user avatar
0 votes
1 answer
27 views

A Reference Block with link populated by Ampscript is throwing 404

Our emails are translated into 20 languages. The translations for each email are uploaded as a Data Extension with Country as primary key. Each email has its own DE. One of the columns contains a CTA ...
user avatar
  • 3
1 vote
1 answer
32 views

Capturing Dynamic Link Clicks with SQL Query

I have an email with RSVP buttons that direct to Cloud Pages. I have followed the trailhead for the workaround (https://trailhead.salesforce.com/content/learn/modules/engagement-splits-in-journey-...
user avatar
0 votes
1 answer
34 views

What would be suitable entry source for my journey? [closed]

Problem Statement: I have to inject records into the journey whenever a customer's status is upgraded to higher from lower. We have a three-status record. Priority Status 1 Silver 2 ...
user avatar
  • 1
1 vote
0 answers
12 views

Redirect AMPScript

I'm trying to do a survey and the user must be redirected to two different pages based on the answer given in the previous page. The Data Extenction field "consumiCarne" is a Text Field and ...
user avatar
1 vote
0 answers
28 views

Duplicate API Calls on HTTPPost

We have added an API call to one of our emails, when activated in journey builder we are seeing the same contact hit the same API twice, sometimes three times ~85% of the time. Here is the JS we are ...
user avatar
0 votes
1 answer
29 views

How to add values from DE to button in email?

I have a problem. In my email template I have a button in "href" which should pull up a link from a certain field. (I have emails in my extension and each email has its own link) So, I found ...
user avatar
  • 13
2 votes
0 answers
11 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 ...
user avatar
  • 21
0 votes
1 answer
32 views

How to use FormatCurrency inside an for loop?

i have a for loop to write the orderItems fields in html, but i can't concatenate FormatCurrency() function in Write(): this is my script: <script runat="server"> Platform.Load("...
user avatar
0 votes
1 answer
30 views

You have sent us an Illegal URL or an improperly formatted request. error in marketing cloud for <a> tag using AMP Script

I have added tag link in email template link below, link working in preview and test while sending actual send not working. <a href="%%=RedirectTo(@link)=%%" target="_blank">...
user avatar
  • 59
0 votes
1 answer
41 views

How to get only href value from link using AMP script?

I have one URL field coming from salesforce and i need only href instead of complete URL using amp script. <a href='https://www.google.com/?hl=en-GB&authuser=1' target='_blank'>Test</a>...
user avatar
  • 59
0 votes
1 answer
33 views

Retrieve info from another DE in Ampscript [closed]

I have 3 Data Extensions: one used as target which is the audience to contact one which stores products and email addresses. Here the email addresses match the ones present in the previous DE one ...
user avatar
  • 11
-1 votes
1 answer
36 views

Exclusion script for Journey Builder send

I have two emails with identical content - one is used in one journey, the other in a second journey. However, I want to be sure that if a person happens to enter both journeys within a short ...
user avatar
  • 1
0 votes
1 answer
33 views

How change label in <a> tag in email template?

I am trying to add tag in email template like <a conversion="false" data-linkto="other" href="%%=v(@URL1)=%%" style="color:#0A4A8E;text-decoration:underline;&...
user avatar
  • 59
1 vote
1 answer
70 views

Data Extension Caching when doing Lookups

Script description: There is a script that aims to retrieve up to 200 records from the Data Extension, perform some manipulation with retrieved values and lastly delete processed records from the ...
user avatar
  • 2,384
0 votes
1 answer
23 views

Pass a variable from AMPscript block to Client side JS?

I have an index.html file with the following structure: %%[ SET @contactId = AttributeValue("_subscriberkey") ]%% <!DOCTYPE html> <html lang="en"> <head> &...
user avatar
  • 13
0 votes
0 answers
31 views

How to retrieve lists that a subscriber resides on with AMPscript only?

I successfully retrieved the Subscriber Object for a subscriber that I manually created for testing purposes. This subscriber is active on All Subscribers list and also on 4 publication lists. %%[ ...
user avatar
  • 13
0 votes
1 answer
24 views

how to use child standard object data in the personalized mail while your journey salesforce data entry event is on parent object

I am creating a journey for which the entry event is a salesforce data event on a contact object. But I have to use child object field data in the mail to personalize the mail. For example Parent ...
user avatar
  • 1
0 votes
1 answer
38 views

ampscript lookup to limit number of rows to display if there are more than 5 records

hello currently working on an email that has table and the records are coming from another DE so im using LookupRows using contactId, I want to limit the number of records to be displayed to 5 however ...
user avatar
2 votes
1 answer
42 views

Avoid break line when the field is empty breakline

I am using AMSCRIPT to personnalize some sender details in an email block at the end of the email. This block contains several lines : name of the account first name, last name, phone email adress ...
user avatar
-1 votes
1 answer
32 views

IF Ampscript - if a record from one data extension exists in another

Is there a way to write an IF ampscript to say: If records from Data extension A, exist in Data extension B, then display 'Welcome Back' ELSE display 'welcome'?
user avatar
0 votes
1 answer
23 views

AMPScript convert "feb" to 02

I'm looking to convert a data field value (@OPT2) from "01-Feb-22" into "01-02-22" to be displayed on a landing page. The reason is I want to display the date in French too and ...
user avatar
3 votes
1 answer
59 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 ...
user avatar
  • 2,585
0 votes
1 answer
16 views

Product name upsert to a data extension on click and redirection to cloud thank you landing page through AMPscript

as the title says, I have a number of products in an email in SFMC. On click on any of the products, I'm trying to capture the product clicked on, upsert the name of it to a Data Extension then open / ...
user avatar
  • 369
0 votes
1 answer
39 views

How to optimize the email AMPscript code that has a lot of lookups?

I have built a dynamic email template. This email template pulls the data from the Data Extension based on email name ( example: subject line, pre-header, content area, headers etc). For each field ...
user avatar
  • 5
2 votes
0 answers
22 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 ...
user avatar
  • 31

1
2 3 4 5
59