Skip to main content
Planned maintenance impacting Stack Overflow and all Stack Exchange sites is scheduled for Monday, September 16, 2024, 5:00 PM-10:00 PM EDT (Monday, September 16, 21:00 UTC- Tuesday, September 17, 2:00 UTC). The email/password authentication method will be unavailable for logging in and registering. Read more here

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
33 views

multiple DE in cloudpage

I am creating a cloud page and I'm new to amp script and no programming knowledge at all. I have 2 DE, is possible to call 2 DE in one cloudpage? <table> <thead> <tr&...
yajirobi's user avatar
0 votes
2 answers
69 views

I am a beginner. Wrote the below amp script code. I have tried many things but cant get rid of this error

Below is my piece of code- An expected comma is not found in the varible declaration. Script: Var @fname,@lname,@plantype,@gender ListID: 59096 Index: 14758 %%[ Var @fname,@lname,@plantype,@gender ...
gajendra saran's user avatar
0 votes
1 answer
35 views

Content builder - Formatting numbers of different lengths to show in different ways

Using content builder to create emails, and pulling numbers in from a data extension. Some are 9 digits and some are 10 digits. Using 'format number' to show spaces between some of the digits so they ...
John Down's user avatar
0 votes
1 answer
53 views

Interactive Email: AMPScript on Cloud Page not executing

I am trying out interactive email for the first time - so far, its cool - but my company is a global company which means I need the labels for the form to be able to support multiple languages. The ...
JulieHurtz's user avatar
0 votes
1 answer
89 views

Handling Microsoft SafeLinks Double Activation in Email Links with AMPscript

I'm currently facing a challenge with Microsoft SafeLinks in an email marketing context. SafeLinks, a feature in Microsoft's security suite, pre-fetches URLs for security checks and then again when a ...
Dandys23's user avatar
0 votes
1 answer
51 views

JWT | Does anyone know why JWT generated via AMPscript is diferrent than generated via JWT.io

Ref link1 = AMPscript JWT = https://ampscript.guide/getjwt/ Ref link2 = JWT official site = https://jwt.io/ Comparison link = https://www.diffchecker.com/tEwnbx5h/ JTW generated via AMPscript JWT ...
Vishal Kumar C V's user avatar
-1 votes
1 answer
46 views

Email content changes on browser view

Tool Used: Salesforce Marketing Cloud Process: When a user places an order on the website, they receive an order confirmation email. This email is created using AMPscript in Salesforce Marketing Cloud....
Laxmi dutt's user avatar
0 votes
0 answers
53 views

Update a bitly link with API using AMPScript in SMS

We are using custom back-half links in Bitly to redirect to a CloudPage for capturing clicks in SMS campaigns. However, we encountered an issue: Bitly only accepts static links. This means that if I ...
Nikkie V.'s user avatar
0 votes
0 answers
43 views

An error occurred: Unable to retrieve security descriptor for this frame

I am trying to post an image in third party tool using below code, but getting an error" An error occurred: Unable to retrieve security descriptor for this frame." Can any one please help me,...
Rajitha Manthapuri's user avatar
0 votes
1 answer
49 views

How to populate FromName and FromEmail in EmailSendLog with both regular and dynamic Sender Profiles

Context: I've setup a Dynamic Sender Profile solution using a Code Snippet block call with AMPScript variables and a Configuration DE. Solution works perfectly fine BUT I've come across a limitation ...
Noronha's user avatar
  • 15
-1 votes
1 answer
86 views

I'm trying to implement a bubble sort in ampscript for sfmc but it doesn't work

%%[ set @array = "1,3,11,6,4,8,24,27,13,99,7771,26" set @arrayList = BuildRowsetFromString(@array, ",") set @arrayLength = RowCount(@arrayList) for @i = 1 to Subtract(@arrayLength, ...
Reena Joseph's user avatar
0 votes
0 answers
58 views

Marketing Cloud Page try/catch question

I'm using ampscript to update Salesforce records using the UpdateSingleSalesforceObject function. This happens after the cloud page posts to itself and I use the RequestParameter function to grab the ...
Mizuno98's user avatar
0 votes
0 answers
13 views

Android devices adding tracking data to tel: schemes in emails

I work as an email developer, I primarily work within Salesforce marketing cloud. In some of the emails I work on, we have two CTAs: 'Call Us' and 'Email Us'. Since the links are not a standard tag ...
colosull's user avatar
0 votes
1 answer
76 views

CreateSalesforceObject creating duplicate records

I have been sending email campaigns using which my subscribers can click on a cta button and request a callback. This CTA redirects to a cloud page which consists of the AMPscript to create a callback ...
NDSF's user avatar
  • 11
0 votes
1 answer
71 views

Image Upload Feature on Marketing Cloud Landing Page Not Storing in Data Extension

I'm working on a project in Salesforce Marketing Cloud and need to create a landing page with an image upload feature. I have already set up a Data Extension named "ImageUploads" with the ...
Rajitha Manthapuri's user avatar
0 votes
1 answer
80 views

How to get status of query definition

I want to get the status of a query definition. I am interested in knowing if it ended up in an error or not. I run query definitions from a script, but I cannot access the information about whether ...
martechnotes.com's user avatar
0 votes
0 answers
52 views

AttachFile function not retrieving values from Data Extension

I'm facing an issue while using the AttachFile function in SFMC and would appreciate your help in understanding the behavior better. When I use the function statically, assigning a value directly to ...
Padam's user avatar
  • 1
0 votes
1 answer
46 views

Ampscript set variable not working

Given that I have already declared my variables... I am trying to set some values to those variables, based on whether a row of data already exists or not... VAR @brandID, @Content, @Header, @...
Tim's user avatar
  • 3
0 votes
1 answer
82 views

AMPScript creating multiple entries

%%[ set @id = _subscriberkey set @communities = 'Community-id' /* replace this id with your community ID */ var @createdemographic set @createdemographic = CreateSalesforceObject( 'Demographics__c', ...
NDSF's user avatar
  • 11
0 votes
1 answer
41 views

Amp script claim row is claiming same row twice

I'm running into a weird case where the claimrow function is claiming the same row for multiple users. What I am trying to do is prevent a user from receiving an email if he/she already received a ...
emilio_'s user avatar
0 votes
1 answer
65 views

Need help with optimizing JSON-content feed loading inside of a Newsletter template

I have a question about optimizing Salesforce Marketing Cloud Newsletters with JSON-based feed content for production sends. The vast majority of our newsletters sent via Marketing Cloud are comprised ...
Alex Baker's user avatar
0 votes
1 answer
110 views

What's wrong with my substring function?

I'm trying to loop through a string using AMPscript only and pick out specific values. The problem is once it tries to update the string using the substring function the cloudpage errors out. Example ...
smithky3's user avatar
0 votes
1 answer
37 views

Hyperlink values within an IF EMPTY Ampscript statement

all. This is an Ampscript/SFMC inquiry below. I am trying to solve for adding a hyperlink to an IF EMPTY statement and have it render outside. You can see the bold start a chapter identified below is ...
Bulldogstall's user avatar
0 votes
1 answer
78 views

CloudPage InsertData() shows 500 error message if data already exists in DE

How can I get the CloudPage not to go to the 500 error page if I am using InsertData() but the data was already existing in the Data Extension? It works the first time if it doesn't exist, but it the ...
randomface4's user avatar
0 votes
2 answers
63 views

I'm trying to convert 31-05-24 into May 31, 2024

I'm trying to convert 31-05-24 into May 31, 2024 using Format or FormatDate the best i can get is 31-05-24 -- i've even had success with converting 31-may-23 do I need to ask the client for a ...
Gaël Porteu de La Morandière's user avatar
0 votes
1 answer
69 views

WAC - Parameter Management for LinkName Manipulation

I have an Email with an Image content block that has a link a link to Facebook. The link has a title of Facebook and an alias of facebook. In the Web Analytics Connector (WAC) Parameter Management ...
GS Dev's user avatar
  • 15
0 votes
1 answer
66 views

Error in email preview when using Lookup() with _subscriberkey

I'm new to SFMC and AMPScript. I want to create an email that starts with the name of the employee who receives it, using the Lookup() function to return their name. My code: %%[ SET @subKey = ...
Irina Aldana Filippini's user avatar
0 votes
1 answer
49 views

Send email only if attachment exists in import SFTP Marketing Cloud

I have an incoming zip file containing multiple csv files. I extract and run an automation activity on a specific file name pattern, this is the master data file containing which file goes as an ...
IHaveAQuestion's user avatar
0 votes
1 answer
56 views

Hiding HTML table of code within Ampscript IF-ELSE Statement - Reduce file size?

I am working on an email template with a large number of modules. If I add these modules within the AmpScript IF-ELSE statement - for eg: Display module 1 table of code within in the If statement and ...
user1373287's user avatar
0 votes
1 answer
69 views

Redirect not working in if/else but working in some part of the code

In This code Line 62 & 65 where i have commented out { Redirect(concat(@loginPageURL,"?invalidtoken=",1,"&referer=",@referer)) } The code does not work when i include these ...
UTKARSH SINGH's user avatar
1 vote
1 answer
87 views

Why isn't my link getting populated when using AMPscript

I'm using Salesforce Marketing Cloud and need to populate a link using AMPscript. For example, the link is https://website.com/%%=v(@variable1)=%%/%%=v(@variable2)=%%/%%=v(@variable3)=%% The link ...
hihihi's user avatar
  • 11
1 vote
1 answer
32 views

How to Correctly Exclude Checkout Day in Daily Rate Calculation with AMPscript?

I am using AMPscript in Salesforce Marketing Cloud to parse serialized JSON data for hotel reservations. Each entry contains start and end dates along with a daily rate. I need to calculate and ...
Matt Black's user avatar
0 votes
1 answer
53 views

Update Demographics Object using AMPScript

When trying to update the Contact object using an AMPScript on my SFMC cloud page, my script works fine. However, I haven't been able to figure out how to update the Demographics object using the same ...
NDSF's user avatar
  • 11
0 votes
1 answer
75 views

Required Field Missing Error on Landing Page

I'm encountering the following error when I'm trying to publish landing page: Error Message: "Call to create the salesforceobject Account failed! Error status code: REQUIRED_FIELD_MISSING Error ...
salesforce Developer's user avatar
0 votes
1 answer
68 views

ampscript lookup does not work when field length of the lookup field is not set

This is my amp script code : %%[ Var @email Set @email = Lookup("forgot_password", "email","locale","en-US") ]%% %%=v(@email)=%% The locale field length ...
New Developer's user avatar
1 vote
1 answer
55 views

How to end BuildRowSetFromString in a period

In my DE, I have a list of last 4 of account numbers in one field. The list is delimited by a pipe and will be different for each record in the DE (could be 2 account numbers, could be 100 account ...
butternut_squash_100's user avatar
3 votes
2 answers
93 views

AMPscript Current Sunday

I'm attempting to build a call by date and have that date be the Saturday of the given week. These emails are sent Monday - Friday, I'm struggling to lock down the AMPscript for it. Here is what I ...
Alex Martin's user avatar
1 vote
2 answers
86 views

Use ampscript to check data extension has an EmailAddress field

I've got a custom process which allows users to match manually uploaded data to SF ContactID values. It relies on the EmailAddress field being called EmailAddress and having the correct field type to ...
TCassa's user avatar
  • 898
0 votes
0 answers
40 views

update preferences from a community page to salesforce marketing clouds data extension

I would like to know if I could update the preferences of a subscriber from the community clouds page to SFMC's Data Extension.
Lakshmi's user avatar
  • 11
0 votes
1 answer
160 views

How to update data on data extension using AMPscript?

I need help with updating existing data in a data extension. When a user clicks on an email link to change their status, I need it to be changed in the data extension. For example, if user A has ...
xhb's user avatar
  • 21
0 votes
1 answer
97 views

Pre Header in Salesforce

Ive created a data extension with several attributes , one of them being pre header. This is where my content lies. When I add ampscript in my email it pulls the pre header however when I do the real ...
Molo's user avatar
  • 25
0 votes
1 answer
41 views

How to find the Page ID of the same page where the AMP script is written

Print Page ID on Landing page using AMPscript I am in the process of creating a page to store information from customers who come to the landing page. I want to write it as follows, and I have had no ...
Minkyeong Kwon's user avatar
0 votes
1 answer
58 views

How to show place holder when value is ampscript?

When I want to see TT.MM.JJJJ as a default but because ampscript is used it shows dd/mm/yyyy I have added placeholder and timezone as well but it is not working. Could you please advise on that? set @...
Gokce Altunkanat's user avatar
0 votes
1 answer
63 views

Update the DE using Ampscript from Cloudpage

I've developed a landing page with two submit buttons, CTA1 and CTA2. When a user clicks on CTA1, data should be updated/inserted into DE1. Similarly, clicking on CTA2 should update/insert data into ...
Jain's user avatar
  • 1
0 votes
1 answer
78 views

Invalid index (parameter2) Passed to row function. Index must be less than or equal to the row count -

I am trying to display 3 hotel contents in a for loop but I am getting the error while previewing only for specific contacts. Not able to solve this. Any help would be greatly appreciated. This is my ...
Archana Selvakumaran's user avatar
1 vote
1 answer
112 views

Does SFMC Push Message support Amscript RaiseError Function?

thank you for your time. I wonder if Amscript RaiseError Function works for push message? I tried a few test and it's not working on my end, however I couldn't find any evidence that confirm or deny ...
Khoa Nguyen's user avatar
1 vote
1 answer
155 views

SMS Character Limit with AMPScript

We're using AMPScript to create a send log for all email and SMS sends. In MobileConnect, I can include the AMPScript and the SMS text fine and it's reported as one send however, when using Journey ...
James Lunn's user avatar
0 votes
1 answer
71 views

Upload resulting gif of AMPscript BarcodeURL() to content builder

I want to send a member card as barcode via SFMC/Whatsapp. However, Whatsapp content does not allow the use of the BarcodeURL() function to generate the barcode image. My plan now is to use a code ...
Arthur Noort's user avatar
1 vote
1 answer
111 views

Cloudpage doesn't retrieve the subscriber to update their preferences

I'm setting up a subscription center. It seems like my code works fine when I open the link from the preview email. It recognizes the subscriber and updates the record without any issue. However, when ...
AskingCore's user avatar
0 votes
2 answers
168 views

Cloudpage reloading causing duplicate triggered send

I'm having an issue whereby i have a 'thank you' cloudpage which customer lands on after submitting a form in email. The cloudpage then sends a triggered send email. The problem is that customers are ...
CRMdelaCRM's user avatar

1
2 3 4 5
66