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 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.

0
votes
1answer
10 views

Updating the All Subscriber List when submitting through a Custom Subscription Center

I need help figuring out the process of updating the All Subscriber/publications list when a subscriber changes their subscription status through a custom subscription center that I'm hosting on a ...
0
votes
1answer
27 views

Email Activity in a Journey using Salesforce Data Entry to Personalize Content not working

I have this code in AMPSCript in an Email that is an activity in Journey Builder with a Data Entry source as Salesforce Data Entry Event (Order created). The Salesforce Object is Order and I want to ...
0
votes
1answer
25 views

Dynamic subject with ampscript

I solicit you for the creation of an ampscript code to dynamically change the subject of an email in an automation. I explain I have an email that sent every day but the object is back and hard blow ...
0
votes
1answer
60 views

AMPscript can't declare a variable

I've been trying to print the product rows from a DE in a digital receipt email. Everything works fine unless I want to declare the variables. So the code underneath works perfectly if I remove the ...
0
votes
1answer
47 views

Unexpected error in conditional when using Lookup

My team and I are encountering unexpected behavior involving a shared content area, conditional logic, and the Lookup function. %%[ var @MID set @MID = [memberid] var @StoreClosestNew if @MID == ...
2
votes
2answers
43 views

Mass Update Data Extension Names

Is there a way I can mass update Data Extension names? I have a ton of them which I need to rename. Can SSJS or any API call be used?
0
votes
1answer
22 views

AMPScript For Loop Dynamic Variable

I am trying to get a dynamic variable set inside a script block with AMPScript. Here is what I got: FOR @i = 1 to 5 DO TreatAsContent( Concat( "SET @Test", @i, " = ", 'some value' ) ) NEXT @id ...
1
vote
1answer
53 views

Ampscript IF Statment / Table display Question

I am trying to conditionally display rows in a table. However it seems like the once the code reaches a record where the condition "IF IndexOf(@ClientContent, @MPEContent) > 0 AND IndexOf(@...
-6
votes
1answer
45 views

How to format the variable 'money' using AMPscript FormatCurrency? [closed]

%%[ var @money=125 set at @USD= /* Please finish the function */ ]%%
-6
votes
1answer
38 views

How do I use arithmetic powers of AMPscript to finish this function? [on hold]

%%[ var @abc=10 var @def=12 set @sum= /* THIS PART */ ]%%
1
vote
1answer
39 views

Render Dynamic content based on data filter - AMPscript

We currently have our subscriber data sitting in the data extensions section, from there data filters have been created to segment the main audience into smaller pieces to facilitate certain send ...
1
vote
1answer
41 views

AMPScript SMS InsertDE() function not working in SMS

It seems InsertDE() function is not working when triggered via SMS send (the code resides in the message body). I have tested the same function with a dummy cloud page and it was working good. Has ...
0
votes
0answers
59 views

How to find if an array or list contains a value in AMPscript

I have a customer purchase data extension which has customer id, item id (product id). I have an offer data extension which has a list of item ids. My requirement is to offer products to a ...
0
votes
0answers
19 views

Redirect to the success/error page after Smart Capture submission

I am trying to implement redirect to success/error page on my Landing Page after Smart Capture submission. User should be redirected to the error page in case he has already submitted form with same ...
0
votes
1answer
41 views

Fetching a content from Data Extension in an Email

I am trying to fetch content from one DE(Let's say A) and send it to another DE(Let's say B), where there is no common field between these Data extensions. I used this code below to fetch the data but ...
0
votes
2answers
52 views

ampscript Question

I'm very new to ampscript and am having an issue with a snippet of ampscript showing as blank. This is what I currently have: SNIPPET 1: %%[ set @firstName = Lookup('master','first_name','email',...
0
votes
1answer
51 views

SmartCapture form not validating & not passing hidden attributes

We want to enrich existing data about customers using a SmartCapture form. So, what we decided is to send an email to the existing customer audience with a link to a CloudPage with the SmartCapture ...
0
votes
1answer
57 views

Lookup to Sendlog not working

I want to pull in the view as webpage url from the Sendlog, but it looks like my lookup does not return any results. This is a code snippet from my email: var @vawp, @subID, @jobID, @batchID set @...
0
votes
1answer
38 views

How to record customer preference from SFMC email template

I need your valuable advice to confirm about one of my problem. We have a use case where have to send a SFMC email which have a URL about some event. We would like to give the preference to customer ...
0
votes
1answer
27 views

Remove You've Already Submitted Form

My clients wants to be able to submit a form multiple times and this AMPscript only lets you submit it once. What do I need to remove from the AMPscript to allow it to process multiple submissions by ...
0
votes
1answer
63 views

Variable assignment issue in AMPScript

I have a AMPScript snippet where I am retrieving a variable from a returned row-set and then using the same variable as the value for a simple filter. The name of the variable is @listID. If I don't ...
0
votes
3answers
87 views

Assigning SSJS variable to AMPscript in a Loop

I have a requirement, I need to get all the data extension fields dynamically based on DE customer key and need to pass those fields into AMPscript to execute other functions. Below is my SSJS code: &...
1
vote
2answers
69 views

AMPscript not working in subject line - Removing first 2 '%' characters

I'm using a very simple AMPscript personalization in the subject line. Specifically %%First Name%%. It displays fine in the preview section, but when I perform the actual test send, the subject line ...
-1
votes
1answer
40 views

How to show alert in server side javascript on conditional basis?

I am using server side Javascript and fetching a column from data extension. I want to show alert on the basis of value retrieved from SSJS lookup but whenever i place alert in SSJS code i get 500 ...
0
votes
1answer
62 views

UpdateSingleSalesforceObject function is updating apparently several records

I am using this function to update one record in SalesCloud. I am experiencing a strange behavior: the function is updating several records. My code is retrieving one record, and then I am using the ...
0
votes
1answer
46 views

Personalisation strings with default values

Can we add a default value to a personalisation string (in this case, %%FirstName%%) without 'transforming' it into AMPscript code or adding a default value in the sendable data extension which ...
0
votes
1answer
73 views

LookupOrderedRows with variable WHERE clauses [duplicate]

As the title suggests is it possible to run LookupOrderedRows with a @variable in the WHERE clause. SET @getAccounts = LookupOrderedRows(@AccountDE, 25, @orderByClause, "location_id", @...
0
votes
1answer
58 views

How to access client side javascript variable in SSJS?

I am facing difficulties in showing a message. Below is the problem statement : I have six textboxes on a cloud page which stores six digit coupon code(one digit each). I am trying to show a error ...
0
votes
2answers
43 views

Is it possible to compare multiple values in AMP Script?

I'm learning AMP Script and I need to compare a variable with different countries and I'm wondering if, as dynamic block in Marketing Cloud, is it possible to compare a variable with different values. ...
0
votes
1answer
45 views

Retrieve just one value using RetrieveSalesforceObjects

As the RetrieveSalesforceObjects AMPScript function retrieves a rowset of data, is there a way to retrieve just a single record? For example, if some records match the criteria, only retrieve the ...
3
votes
0answers
43 views

How to control processing of AMPScript using execution context: Name

According to the documentation and The AMPScript Guide, it should be possible to control whether code in an AMPScript Block is interpreted by using a name for the script block. I am aware of the ...
1
vote
1answer
37 views

Use AMPscript to split field at semicolon

How do I use AMPscript to split a field at a semicolon and return each part separately? Example: FirstName;LastName (note, there are no spaces before or after the semicolon) I've started (...
4
votes
1answer
78 views

Using AMPscript/SSJS to unsubscribe from a parent business unit on a CloudPage from a child business unit?

If you click 'Unsubscribe from All' on the Subscriber in the Subscriber Properties modal in the parent business unit's context or when you perform an SSJS subscriber.Unsubscribe(); on a CloudPage on ...
0
votes
1answer
46 views

Redirect link in SMS messages

Is it possible to add the URL link to a specific word in an SMS? For example: Please visit our website for more information.
0
votes
1answer
40 views

Einstein Email Recommendation Content Creation

We want to build a single block of code to be used across a number of Email activities, and we want to "force" one of the variables. Let's assume that we are selling recipes and I want to trigger an ...
1
vote
1answer
68 views

Parameters passed in CloudPagesURL

Is there a list of the standard parameters that are passed when using the CloudPagesURL function? CloudPagesURL passes information in an encrypted query string so it's difficult to determine the ...
8
votes
1answer
104 views

Using AMPscript/SSJS how do you unsubscribe a subscriber from a child business unit?

My goal is to create a page that passes a business unit id and a subscriber key. The page sits on the parent/enterprise business unit, it will receive business unit ids from a child business unit. ...
0
votes
3answers
46 views

Is it possible to prevent from sending email if the lookup ampcript function is null?

Is there any way, if an ampscript Lookup is "null" or if there is no value for a specific contact, to tell to Marketing cloud with ampscript NOT TO SEND the email or to prevent from sending the email (...
1
vote
1answer
41 views

AMPScript Lookup From Child Business Unit

I have a shared data extension that lives in our main business unit, but, is shared across all child business units. I am trying to do a lookup inside the child business unit in content builder. In ...
0
votes
2answers
47 views

A/B test subject lines when using dynamic content

I'd like to A/B test dynamic subject lines, however, I've been told this is only possible for the default version and isn't possible for the other versions. Is there any workaround to this, perhaps ...
2
votes
2answers
50 views

Can we fetch data from Synchronized Data Extension using AMPScript?

I am trying to fetch data using Ampscript from Synchronized Data Extensions to show on a cloud page. Is it possible to do this? I am using lookup function to achieve but not getting data out of it. ...
2
votes
1answer
36 views

Lookup to Journey Data Extension

As every Journey that uses Salesforce Data as an Entry Source creates a Data Extension, I wanted to do a simple lookup to this DE. I additionally added to it a new column with a timestamp so I know ...
2
votes
2answers
75 views

AMPScript/GTL function to check if variable is string or a numeric

Need to check a type of variable in ampscript, in order to use FormatNumber function(that can only work with integer variables). I tried the Handlebars function {{isString()}}, but can't make it ...
1
vote
1answer
63 views

How can I get all the values from a column of a DE?

Having the following Data Extension named "RamiroTest", with just two columns Name and Email How can I print only the Email column values? This is the code I have for the moment, but it's not ...
3
votes
2answers
101 views

Dynamic LookupOrderRows

Using AMPScript, I want to pass from a URL Attribute lookup variables and use these variables in my LookupOrderRows function. The challenge is that not all lookup variables have to be passed by the ...
1
vote
1answer
39 views

Resolving AMPscript Error Codes

I've received a MC Support case for a journey triggered send that outlines these 4 error codes relating to an AMPscript listed below. OMM_FUNC_EXEC_ERROR OMM_VAR_SET_EXPR_INVALID ...
2
votes
2answers
65 views

First “0” is missing when displaying a number starting with “0”, with GTL

I need to display numeric value in transnational email. I'm parsing json with GTL. Some times the payload can have a value like 012345, but in the email the display is 12345. I tried to format with ...
1
vote
2answers
50 views

AMPscript RedirectTo Links breaking + directing to https://click.email

There are a few similar articles about this topic but I haven't found the exact answer I'm looking for. I have a dynamic link in an email that needs to be tracked. When I preview and run a test send ...
1
vote
1answer
82 views

How to use Personalization String within Journey Builder using Salesforce Data

I have created a Journey where the entry event is a Salesforce Data extension and a contact is injected into it when he creates a new record in an object named Application. When it happens, the ...
0
votes
1answer
46 views

Variable not defined on Data Extension but able to print it in content

For parsing variables for the respective values on the email content html blocks, I usually have 2 kinds of variables. The first case. The variable is defined on the sendable Data Extension. The ...