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
1answer
12 views

IF/ELSE script in sender profile

I'm trying to create a dynamic sender profile where the from name and from email change if a value is present in a specific field of the data extension. I want the Lead First Name value and Lead Last ...
0
votes
1answer
16 views

AMPscript SubString Starting Index

Does the index start at 0 or at 1 for AMPscript? Substring(@str, 0, 1) and Substring(@str, 1, 1) have the same result. E.g. If @str = "male". The result in both cases is m.
1
vote
0answers
15 views

SFMC MobileConnect not sending SMS when using AMPScript/dynamic variables

Here's my SMS message: %%[ set @accountUserName = AttributeValue('Account_User_Name__c') set @QRCodeLink = AttributeValue('QR_Code_Link__c') set @eventName = AttributeValue('Event_Name__c') set @...
0
votes
0answers
21 views

Dynamic Content with AMP

I want to create dynamic content with AMP, but it's not working. This is what I created. What am I missing? %%[ var @PLT set @PLT = Lookup("DV_interests_per_contact", "PLT", "...
0
votes
1answer
26 views

Editing running journey email to reference the new Content Block

My Journey email is currently referencing a content block and the HTML code has below ampScript Example : %%=ContentBlockbyKey(“Old_Content_Block”)=%% Now I want to change the above code to reference ...
0
votes
0answers
14 views

On submitting EXTERNAL_REF on landing page, send email to the email id associated with the EXTERNAL_REF entered, with all other bookingdetails in mail [closed]

We have Data Extension "Reservations" in which we have attributes like FIRST_NAME,LAST_NAME,ROOM_NUMBER,RESERVATION_ID ,ARRIVAL_DATE, DEPARTURE_DATE,EXTERNAL_REF(primary key) and many more ...
0
votes
1answer
21 views

Does the location of AMPScript within an email matter when personlizing a subject line?

I am creating an email in Marketing Cloud and I'd like to add a First Name personalization to the email Subject. We have some AMPScript to e.g. capitalize the name etc, which creates the variable @...
0
votes
1answer
56 views

QueryParameter doesn't pick up values from a url

I've created a piece of ampscript that needs to post form data to SalesCloud. Everything works fine, however I'm not able to pass the utm parameters from this url https://cloud.e.mywebsite.com/test-...
0
votes
0answers
26 views

How Count Occurrences of RegEx with AMPScript?

How do we count the number of regex occurrences in a string? If we knew the exact phrase then we could do something like the below: (LEN(Text Area) - LEN(SUBSTITUTE(LOWER(Text Area),"dog",&...
1
vote
2answers
31 views

AMPScript String Evaluation Incorrect

The concat string seems to be incorrectly evaluating string in ampscript. AMP Script - Works %%[/* tag - test 1 <div style="display:none"> */ SET @text = "You are <0>...
0
votes
1answer
22 views

AttachFile() in AmpScript not working for FTP

I am using this code to attach a file from FTP, but it is not working. %%[ var @fileName, @fileAlias set @fileName = "LoyaltyMembers.zip" set @fileAlias = "LoyaltyMembers_FTP.zip" ...
0
votes
0answers
25 views

Attach an ftp in email studio [closed]

I am not being able to attach an ftp in an email .I used the syntax AttachFile('FTP',@filename,@filealias) but unfortunately the mail is not being sent. But it worked in case of an http file. Could ...
-2
votes
2answers
40 views

How can you invoke a triggered send from a link in an email in SFMC?

All guides only point to invoking a triggered send from cloud pages, which I understand. I need to know how or if it is possible to invoke a triggered send just when clicking a link or button from an ...
1
vote
0answers
37 views

Using Journey Builder to update campaign member for both leads and contacts

We have a journey which both contacts and leads are injected into it. We would like to add both of those to a SF campaign without using using multiple decision splits and update campaign member ...
0
votes
1answer
20 views

Ampscript - BuildRowSetFromString with multiple inputs

I need to convert the following string [{"productName":"Product1","productPrice":100,"deliverByDate":"04/13/2021","giftMessage":{"...
0
votes
1answer
14 views

Using date time of today in look up ordered rows -Ampscript

Im trying to use a lookupordered row expression to find rows that have a submission date of today and display them, unfortunately I am not finding any matches. I am unsure if my syntax is incorrect or ...
1
vote
1answer
21 views

Ampscript still throws validation error when if statement is false

I have some ampscript in my emails that sets a variable to either a string or whatever value is in the name of the email, and the logic uses the fields LastLoggedInDate and LastEmailOpenedDate. The ...
0
votes
0answers
15 views

How to manage multiple publication lists in a custom profile center

I am new to AMPscript and have found myself stuck. I have 3 publication lists and I am trying to create a way for customers to pick/choose which ones to subscribe/unsubscribe through a custom profile ...
0
votes
1answer
26 views

Trouble Creating Custom AMP Script Message

I am trying to create a custom email message using IF THEN statement that reads an Attribute through our DE. The message should pertain to what "card tier" the client is. Salesforce keeps ...
0
votes
0answers
29 views

RetrieveSalesforceObjects from child BU

I am trying to use the RetrieveSalesforceObjects() function to look-up an object from child BU but the sync is to Parent BU (and we have sync de in shared de). Is there anything different I have to do ...
0
votes
1answer
31 views

AMPscript <= not working correctly past a certain number

I'm new to ampscript and generally only write it in line, so that might be my problem. However, when I use the code below in my SFMC email, OrderTotal values of 100+ are getting the "OrderTotal &...
0
votes
1answer
34 views

SFMC Reference Block vs. Ampscript code

Quick Question: Is there a difference between a Salesforce Marketing Cloud Reference Block versus an ampscript code like "ContentBlockbyID"? And if you make an update to the source content ...
1
vote
1answer
34 views

multiple lookup rows in a statement

I am looking up rows from a data extension to grab the Product (@Product) and Status (@Status) using App_number as the lookup value. I want to then add a conditional statement in my html to the values ...
0
votes
1answer
29 views

RMM Save to Data Extension

Can we set up a script in RMM to save email responses into a data extension? My original idea was to set up an inbox parse content and then ship it to an SFTP, but, that is less than ideal if there is ...
0
votes
1answer
37 views

Marketing Cloud: AMPscript redirect not working

When trying to use 'redirect', my 'starting' page will no longer load (returning the 500 error). Not sure what I'm doing wrong here. FYI: If I remove the redirect code, the page loads just fine. ...
1
vote
1answer
33 views

SFMC SSL certificate in Third Party API request

I want to call a Third Party API that requires a SSL certificate. How can i use a SSL certificate for these request using SSJS or Ampscript?
0
votes
0answers
25 views

How to retrieve value from KeyStore with AMPScript

I created a salt key in the SF KeyStore; how do i retrieve the key and use it in AMPScript? Thanks.
2
votes
1answer
77 views

Connect SMFC to Github

Has anyone had any success connecting things like content builder or cloud pages to GitHub? I have been searching far and wide and have come across this amazing repository that almost does what I need ...
0
votes
1answer
93 views

Using code snippet in Exclusion Script Triggered Send

I'm trying to create an exclusion script based on the output of a Code snippet which looks like: <script language="javascript" runat="server"> Platform.Load("core",...
2
votes
1answer
44 views

French time format - date and hour

I need to adapt appointment date & hour US format to the french time format in Marketing Cloud. I have this code but nothing display in the email : %%[ VAR @firstname SET @firstname = ...
1
vote
1answer
35 views

Passing dynamic Ampscript block to email studio template

We're building an email template in Marketing Cloud Email Studio where we're passing the HTML content of the email dynamically as subscriber value. The template looks simply like %%=AttributeValue('...
1
vote
0answers
29 views

Issues using inline RedirectTo(Concat…)) together with Base64Encode

I'm having some issues understanding a custom unsubscribe link that links to a 3rd party landing page. What I would like to do is this: <a href="%%=RedirectTo(concat('https://example.com/...
0
votes
2answers
33 views

How to hide Interactive Email Form based on condition?

I am using the Interactive Email Form feature to allow submitting user data straight from the inbox and enable design configuration by non-technical Marketing people. I would like to enable a way to ...
0
votes
0answers
19 views

Looking to Populate Hidden Field with Concatenated Date and Email in a Cloud Page / Smart Capture

I'm looking to populate a hidden field within my Smart Capture form with a concatenated value. I'm not sure if I'm setting up the Ampscript properly. I've tried to insert the AMPscript in a standalone ...
0
votes
1answer
35 views

How do you deal with Non GSM Characters in API driven SMS?

We are sending API driven SMS for things like product out of stock and order confirmation. The data being sent into our endpoint sometimes includes non GSM characters (like registered trademark), ...
0
votes
1answer
26 views

Help with IF ELSE Statement in AMPScript

I am trying to add another piece of logic to this working code below to check if there guess is correct for those who fall after the else statement only. %%[ SET @sid = QueryParameter('sid') SET @...
0
votes
3answers
67 views

ClaimRowValue In SSJS alternative [closed]

Is there an alternative to the ClaimRowValue function in SSJS? this code in AMPScript %%[ var @couponRow var @couponCode var @CustomerID set @CustomerID = AttributeValue("CustomerID") set @...
1
vote
1answer
29 views

ContentBlockByName not resolving within AMP mime-type

We're very excited about using the new AMP mime-type available within SFMC, but are experiencing some troubles with the AMPscript Functional Reference ContentBlockbyName not resolving within the code. ...
0
votes
0answers
31 views

Outputting a variable via TreatAsContent(@QR_Code) into email doesn't render the image due to the image's src attribute changing during email send

I have a transactional email that is triggered via API - and one of the data points being passed in is a QR Code link. The data for this is simply an <img> tag that hits up Google's API to ...
0
votes
1answer
40 views

Convert date to month day using AMPscript

I have a DE with a date column in this format I desire to change this in the email to read 23 March and i am using FormatDate but it doesn't work Below is my code set @Outagedate = field(@row,&...
0
votes
1answer
32 views

SFMC RMM: Using AmpScript in User Specified Information

The Sendable DE I am using to send emails has fields ReplyToName and ReplyToEmailAddress to which a reply to that email should go to. These two data elements may be different for each email sent. I ...
0
votes
1answer
44 views

AMPScript IF ELSE statement returns 'FALSE' unexpectedly

I have the following AMPScript: %%[ var @Custom_2, @variable set @Custom_2 = Custom_2 if Not Empty(@Custom_2) then set @variable = concat(" ",@Custom_2) elseif Empty(@Custom_2) then ...
0
votes
0answers
24 views

How to retrieve session message content from whatsapp with AMPScript?

I have a use case where I need to simulate a whatsapp chat in Marketing Cloud, so i need to retrieve a response to a session message and save it in a Data Extension. Is that possible with AMPScript o ...
0
votes
0answers
66 views

Update Object in SF via cloudpage form submission

I have a use case where I am preparing a cloudpage form with mobile number input field. Upon hitting submit, the mobile number should update in the sales and service cloud under Mobile field. I don't ...
1
vote
2answers
37 views

HTML template using AMPscript error

I have created a HTML template where in html block I have pasted html code and then used the social block to create the footer. Now I am using AMPscript variable %%[ Var @Email, @fname, @sname, Set @...
0
votes
1answer
25 views

Display updated values on submission of a Form

I have a form similar to a profile center. On submission of the form, an InvokeUpdate call is made to update the record details. I have the form tag as <form action="%%=RequestParameter('...
0
votes
0answers
18 views

Retrieve data from a data extension, filtering by a specific field value in a trigggered send

I am trying to fetch content dynamically for a triggered send email. I have a field named event_id from the triggered send which I wanted to match with other data extension "Livestream Events DE&...
0
votes
1answer
19 views

Retrieving multiple records from sendable DE

I have a DE which can contain one or multiple rows for the same customer & this depends on the number of products they subscribe in an application. We want to email them the status of these ...
1
vote
1answer
45 views

Fetch the email name used in Journey via ssjs

I am trying to create a cloud page in which when I enter any journeys name with the click of a button I should get the name of all the emails used with that Journey. Some of these journeys in my ...
3
votes
1answer
45 views

Show/hide drag-and-drop content blocks using ampscript

I have successfully been able to show/hide drag-and-drop content blocks on a cloudpage by doing the following: Adding an HTML block with opening IF statement Adding in a Image block with the image ...

1
2 3 4 5
54