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
0answers
17 views

Custom unsubscribe and preference center optoinnns? [closed]

I have a task of getting all the option applicable by which means a custom one click unsubscribe and preference center can be made.We have used cloud connect between sales cloud and marketing cloud. I ...
0
votes
1answer
39 views

How to setup URLs dynamically when using WAC and not loosing the tracking service system

I am building URLs dynamically using AMPScript and values stored in a data extension. We are using Web Analytics Connector WAC, so the AMPScript vars are not interpreted properly by the WAC when ...
0
votes
2answers
33 views

500 Error with Sales Cloud-integrated lead capture form using AMPscript

I am new to writing AMPscript. I'm attempting to place an ales Cloud-integrated lead capture form using AMPscript on Cloud Pages within Marketing Cloud using the content builder. I keep getting the ...
2
votes
1answer
89 views

Dynamic Link Bitly V4

I need to send a link to a CloudPage through SMS with an query param (www.example.com?id=XXXX), which the CloudPage will use to get value from a Data Extension and pre-fill some data to Contacts and ...
2
votes
1answer
59 views

How to avoid BLANK records created by UpsertDE function, on PUBLISHING the cloud page!

I have noticed that by default when we PUBLISH the cloud page, all the AMPscript will be executed! By this behaviour the below code creates a BLANK record in my Data Extension. UpsertDE("DE_NAME",...
-3
votes
1answer
39 views

Calling ampscript [closed]

The problem is the connection between the template ampscipt names and the set names in the library. It’s not connecting and pulling the copy %%[ Set @m1 = 'DIN' Set @p1_copy = TreatAsContent(Concat(...
0
votes
1answer
31 views

HTML formatting not being applied to email

I've got a content block that is prefaced with some AMPscript, and then tries to apply HTML styling for the actual email copy. However, the HTML styling isn't being applied. The system default font ...
2
votes
1answer
41 views

Imitating Control Groups using AMPScript?

I am aware of the fact that there is no built-in functionality for control groups in the Marketing Cloud. The workaround I thought of was to apply the control group in an SQL Activity in the ...
1
vote
1answer
48 views

Getting Function name error when I preview

I have some ampscript code to read from a data extension and populate the email template. When I go to preview I get this error. "Invalid value specified for function parameter. Function Name: row ...
0
votes
1answer
37 views

Show nothing if the field is null, but show the value if it's populated

I want to hide the tr that holds the values %%CouponCode%%, %%CouponDiscount%% if the field is null/empty. Show the value if the fields are not null/empty. Here is my code below %%[ var @hide ]%% %%...
0
votes
2answers
29 views

post data from two custom forms to one row in a data extension using Ampscript

instead of using a 3rd party survey tool - my organization has chosen to roll-out NPS using Ampscript. My challenge is two-fold: 1) The 0-10 score form is built into an email 2) The follow-up ...
0
votes
1answer
23 views

AMPScript to Overwrite Personalization/DE values in Content Only

We have this DE that has TrackingCode and OtherID fields. Is there a way to overwrite the %%TrackingCode%% value (this should show as TrackingCode+OtherID+DateTimeNow when the comm is sent)? Now, we ...
-2
votes
0answers
21 views

Getting error when attempting to resolve a script expression and more [closed]

I'm getting the below 'Subscriber preview failed to generate' error message. An error occurred when attempting to parse HtmlEmailBody content for HTML content. MemberID: 110006538 JobID: 0 ListID:...
2
votes
2answers
49 views

Search within a BuildRowSetFromXML or XML for value

Edit: to clarify, IF "abcd" is contained in XML, then output X. OR, IF "abcd" is contained in BuildRowSetFromXML, then output X. I need ampscript that will search for a value within a ...
0
votes
1answer
64 views

Cant figure out where to fix IF statement error

im trying to fix this this ampscript error. I get a message saying Error An IF statement is not closed with the required ENDIF statement. Can anyone take a look at this script to see what i'm ...
3
votes
1answer
50 views

RetrieveSalesforceObjects no working in text response International long code

I'm coming across a strange issue. Texting companystop to a international long code that runs this code You have been unsubscribed %%[VAR @mobilenumber,@rc,@rows SET @mobilenumber = [MOBILE_NUMBER] ...
2
votes
1answer
42 views

Calling Dynamic Column Name Resulting in Truncation

I've got a bit of a quandary. I have a Looping Block that is supposed to parse through different column names to pull the appropriate Value from a DE. The problem is that the Variable that determines ...
-1
votes
0answers
49 views

How to use AMPscript To Hide/Unhide text

I have an issue and its kind of a challenging one. So I have an email that is translated into 9 languages. I use AMPscript to fire off which language to use based on a user's lang pref in the system. ...
1
vote
2answers
113 views

Customer Satisfaction in Email

I want to implement a Customer Satisfaction section at the end of my emails. It will be a few pictures with emoji faces that when pressed I want them to store the value straight into a Data Extension ...
0
votes
1answer
45 views

IF statement error

I have a paid program that I'm trying to promote and I'm trying to send a block of content within an email only to the customers who don't have it active. I wrote this if statement but I'm getting an ...
0
votes
1answer
48 views

Ampscript “lookup” don't work for synchronized data extension “Case_Salesforce”

I am trying to extract data from synchronized data extension "Case_Salesforce" to show on an email. Is it possible to do this? I am using lookup function to achieve. I can get synchronized data ...
0
votes
2answers
25 views

AMPscript update needed - If blank

I'm currently using this AMPscript to handle if First Name is blank. %%[ VAR @firstName SET @firstName = AttributeValue("First Name") ]%% %%=iif(empty(@firstName),'',@firstName)=%%, I can say.....
0
votes
1answer
27 views

Tweak to existing AMPscript to add a further clause

I'm currently using the following AMPscript which doesn't how the Variable Scholarship Title and Amount if those fields are empty. This works as expected (as it was provided by some kind souls on ...
0
votes
1answer
24 views

Join two RequestParameter in one field with AmpScript?

how can i join two parameters inputing this two parameters in one field data extension? For example, in my html form i have the input=firstname and other input=lastname With AMPscript i will update ...
0
votes
1answer
70 views

AMPScript - Send Logging VAWP/Send Time Contextually Breaking

I'm having issues creating a View in Web Browser page via a send logging Data Extension. As I need to use Display Send-Time Content Contextually. Currently, I have: %%[ var @SendLogData, @SubLookup, ...
0
votes
3answers
71 views

AMPscript - Showing a fallback value if field is empty

I'm using this AMPscript to pull in a father's first name: %%[ SET @rows = LookupRows("Contact_Salesforce","Id", _subscriberkey) SET @row = row(@rows,1) SET @firstName = field(@row,"...
0
votes
1answer
40 views

AMPscript required. Show nothing if a field is empty

I've attempted to use the following AMPscript to show nothing if a field contains no value. It is erroring, no doubt because there is an obvious syntax error somewhere, but I cannot see where. Any ...
1
vote
1answer
41 views

Data from Cloudpage to another Cloudpage

Is it possible to work with data using AMPscript to create this flow? e-mail -> cloudpage -> cloudpage I'm working with this flow where i have a hidden attribute in e-mail -> cloudpage. And my ...
0
votes
3answers
57 views

Using RedirectTo() with an #anchor on the URL

SFMC automatically appends tracking information to our URLs at time of send. For example: https://mywebsite.com Becomes: https://mywebsite.com?utm_campaign=xxx&utm_medium=email Is it possible ...
0
votes
2answers
84 views

Custom preference center - help with existing code

Our SFMC org is multi org enabled and one of the child BU's is integrated with a sales cloud sandbox. Being multi-org we have to build a custom pref center. I have created a one click unsubscribe SFMC ...
0
votes
1answer
47 views

Updating DE through SmartCapture in CloudPage

Consider a scenario where a mail will be sent to contacts in Data Extension. The mail contains a button that will redirect to CloudPage. This cloud page has a smart capture that will prepopulate ...
1
vote
1answer
52 views

Creates a trigger send definition in Marketing Cloud Using REST API or SSJS

I follow the link: "https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/createSendDefinition.htm" to create trigger send definitaion . I got the same response as mentioned ...
0
votes
2answers
47 views

For loop to display data only when DE has data in it

There are few fields in the Data Extension DeptID, BusinessID, StateID. I want it to print the value only if that value is present in the DE. Eg, if the DeptID is blank/null it should print ...
0
votes
1answer
38 views

Utilizing Date Time Lookup in AMPScript on Marketing Cloud

I'm trying to run an AMPScript in my emails where I'll be able to link in some meta data on my subscribers. I'd like to utilize when they signed up as a point to discern if the subscriber is new, ...
0
votes
1answer
54 views

HTML Button and AMPSCRIPT in LandingPages

I have an HTML & CSS Landing Page where my goal is when the customer click on the button: he will populate a Data Extension and new window will open in the same tab: <button class="button ...
0
votes
1answer
40 views

Exclusion Script with Multiple DEs

Can you use multiple DEs in an exclusion script for journey sends? I am currently using this template: ROWCOUNT(LOOKUPROWS("DE", "Email", emailaddr))> 0
0
votes
0answers
47 views

Why Alias name is not getting track in Link Name for CloudPageURL function

We have multiple CTAs or Links in single email and we are using the CloudpageURL function to redirect the subscribers based on Expiry date condition along with Alias. But alias in not getting track ...
0
votes
2answers
41 views

Issue with passing the variable from SSJS to AMPscript

Used AMPScript and SSJS to generate an encrypted JSON message and pass this encryped JSON (payload) to the external system using a URL. However, the last line in the below code is not picking the ...
0
votes
0answers
30 views

Content not showing in email from external DE which contains JSON

I am pulling data into a email template, the DE contains JSON. If I select the DE within SFMC email Subscriber Preview and Attributes the email renders correctly. I want to pull in using LookupTable, ...
1
vote
1answer
46 views

LinkName/alias not being recorded in the _click data view

I'm running into an issue where a campaign that has been sending for the last few months seems to not have the LinkNames that were clicked being recorded. When we launched this project, we did our ...
0
votes
1answer
59 views

cannot redirect to cloud page from a different business unit

I have a custom preference centre and I want to be able to redirect to it from different BUs in my account. I am able to redirect OK and works as expected when I redirect from the BU where the cloud ...
2
votes
1answer
27 views

Get the Name of a MobileConnect message as an AMPScript variable

I'm building a "master sent log", which is essentially a DE that captures info about all email and sms messages sent from Marketing Cloud. It captures this using AMPScript in the email that uses a ...
0
votes
1answer
34 views

Convert the subscriber information in data extension (Marketing Cloud) into JSON message (in email content) and send it to external system

Convert the subscriber information in data extension (Marketing Cloud) into JSON message and send it to external system - Can this be done using AMPScript or Do I need to rely on SSJS (Server Side ...
0
votes
1answer
44 views

Editing AMPScript

I'm trying to edit the AMPScript from the below. However, I could not figure out a way to make changes to this code. Is it something to be done with permissions?
0
votes
1answer
58 views

Help Adding an IF statement to render unique text string in body copy

I am trying to use an AMPscript variable to make some text in my footer section dynamic to our business units. I've created the field (@member_busname)in my test data extension and the variables I ...
0
votes
0answers
59 views

HTML Tags being removed automatically

I am building hyperlinks that are included dynamically in text blocks using AMPScript in Marketing Cloud Emails. It used to work properly but after enabling Web Analytics Connector (I supposed it is ...
0
votes
2answers
43 views

ERROR 500 when using UpdateSingleSalesforceObject

I've created a landing page that updates some fields in Salesforce Object 'MktStatus__c'. %%[ var @updateRecord set @sk = '003D000000zm6gXIAQ' set @mct = '03' set @fieldname1 = concat('...
0
votes
1answer
32 views

Ampscript and deliverability

Can AMPSCRIPT degrade email deliverability or send emails more easily into Spams ? Thank you. Ludivine
0
votes
1answer
53 views

How can I write a VAWP link to a sendlog DE in Salesforce Marketing Cloud

I am attempting to write the emails VAWP link to a SendLog DE at the time a send. I have written the script below but it only writes to the first row of the SendLog. Please advise. %%[ Set @JobID = ...
1
vote
1answer
58 views

Font in Marketing Cloud Pages

I'm running into issues with slow speed on pages, and I noticed that there is a huge text string in our pages. I believe it's base64 encoding. I'm not sure if this is is it, but is this normal for ...