We’re rewarding the question askers & reputations are being recalculated! Read more.

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

Custom Preference Center and Upsertdata for Data Extension

I am working on a preference center and looking to use the Upsertdata to populate/ or update records in a data extension. The code is rendering fine in cloud pages but is not actually pulling in. ...
0
votes
3answers
25 views

AMPscript question - need precise syntax to show copy dynamically

I'm trying to write a bit of AMPscript that does the following: IF firstname exists say "John, your" IF no firstname say "Your" I tried this, but it doesn't work: %%=iif(empty(@firstName),"Your", ...
1
vote
1answer
29 views

Ampscript GET view_email_url

Hello I have a problem with an ampscript code I can not get the online version and send it in salesforce cf the following code: %%[ var @contactId, @campaignId, @id, @contactRows, @limitRow, @nom, @...
1
vote
1answer
40 views

Suppress specified links within emails

I am looking to suppress a specified AMPscript personalization string link within the body of one of my emails. It's %%view_email_url%% that I don't want to be tracked. I tried RedirectTo and other ...
0
votes
2answers
41 views

lookup table from another DE

I created this simple test but it just seems not to be working, I am trying to pull data from another DE that is not linked to the email: %%[ var @surname set @surname = lookup('test_DE_name','...
0
votes
0answers
33 views

I want to retrieve multiple values from one content block to nested content block in marketing cloud

I want to retrieve multiple values from one content block to nested content block in marketing cloud. Actually I one primary content block which I am using in Email Template, where in that content ...
0
votes
1answer
32 views

Using AMPscript to populate email, sending to a different DE

So here's my use case: I need to send a weekly email containing all upcoming webcasts from our ecommerce site to our our subscriber base. I have a file of website products and I have a separate DE of ...
2
votes
1answer
468 views

AMPScript, Checking values in a row

Please forgive my beginner level understanding here, I've been thrust into modifying an email that hasn't been touched in a few years, and I've never used AMPScript before. I'll try to keep this ...
0
votes
0answers
47 views

Marketing cloud - Amp script dynamic values cloud pages [on hold]

I have 24 campaign statuses in SF CRM when an email is sent to customer through Journey builder status being set on campaign member as 1 email sent and when the same person responds to our email we ...
2
votes
1answer
41 views

Dependent dropdowns in Cloudpages and Dropdown values to be pulled dynamically from a DE without page refresh!

I have a cloud page set up as below. https://i.imgur.com/Fjf2zwf.png And 2 Data Extensions as below, https://i.imgur.com/ZoS4aCu.png https://i.imgur.com/cOzdEH3.png I need to achieve the below, 1) ...
0
votes
1answer
42 views

SSJS and AMPscript

I'm trying to output message if there is an error and i have very little knowledge in javascript in general. Could I get some feedback on if the following would work or how I would go about : If ...
2
votes
1answer
33 views

AMPscript syntax

I have this piece of AMPscript which shows different preheaders based on language. Except two, GB and JP, all of the others show the relevant preheader. The data extension has the right value and it ...
0
votes
1answer
945 views

AMPscript Substring to capture last characters

I tried applying the method someone posted here AmpScript to select Right or Left characters from a string but "-" gives me an error in Salesforce Marketing Cloud. This is my code: Set @...
3
votes
1answer
52 views

Send emails using Salesforce Reports based on Custom Object

I want to send emails using a Salesforce Report which is based on Custom Report. I have created an AMP Script Code in order to fill some fields but I don't receive the email. This is the code: %%[ ...
2
votes
1answer
39 views

Marketing Cloud - Is there a way to disable WAC String for a specific link (ex. Tracking Link) with AMPscript or otherwise?

A client recently went live with a Commerce Cloud website / Marketing Cloud integration. Marketing Cloud is sending a Shipping Confirmation triggered email. The tracking link in the Shipping ...
0
votes
2answers
57 views

Date Specific AMPScript

Trying to expand on this original post to generate dynamic content based on a specific season of the year. Loading content block using AMPScript based on specific date of the year I updated my code ...
0
votes
1answer
29 views

Pre header Variable Question

Hello I'm fairly new with Marketing Cloud but trying my best to be on top of it. I'm doing a campaign wherein I include the number of days left for someone to redeem their freebies. I set the ...
0
votes
3answers
40 views

Passing subscriber values from Marketing Cloud Cloud Page to Marketing Cloud Preference Cloud Page [on hold]

We have a case where we would send an email to a list of subscribers, which would have a link to a Marketing Cloud landing page with more information about the product offerings. On that page we would ...
3
votes
1answer
60 views

Collect tracking code is not working properly

I'm currently implementing the collect tracking code to capture the User info wherein I'm able to get the user's email id into the tracking data extension (IGO_PROFILES) but not able to capture the ...
1
vote
1answer
616 views

RequestParameter and view_email_url

Is it possible to send extra parameters to view_email_url and then pick them up and use them on the web version of the email? I would like to do this so I can perform different actions, such as ...
0
votes
1answer
64 views

Why are my AMPScript variables rendering in send preview, but not in test send?

I have a series of AMPScript variables and statements, that are resolving perfectly fine in the send preview. Once the test is sent out, some of these variables do not resolve and some of them do. ...
1
vote
0answers
56 views

How can 'RaiseError' and 'InsertDE' AMPscript functions be used to catch ANY error in a Triggered Send?

We currently have a Triggered Send Definition that is encountering errors occasionally and preventing further emails from sending. Marketing Cloud support has been able to provide some error messages, ...
0
votes
1answer
47 views

separate one column value having comma as delimiter

How can we separate one column value having comma as delimiter using Ampscript. Example : We have hello, world in ABC Data Extension in Column "Name" I want to separate both of them using Ampscript. ...
1
vote
1answer
27 views

Retrieve Subscriber list using soap api in ampscript in cloud pages

Ampscript code which need to be converted to Soap API in Cloud page : %%[ SET @rr_1=CreateObject("RetrieveRequest") SetObjectProperty(@rr_1,"ObjectType","Subscriber") AddObjectArrayItem(@rr_1,"...
2
votes
1answer
105 views

RaiseError() - additional arguments

Wondering if anyone can shed light on ordinals #3-5 for the RaiseError() function? Particularly interested in #5. Ref: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-...
-4
votes
1answer
40 views

How to create a task for Salesforce cloud crm using ampscript [closed]

Please advise how to create a task for Salesforce object in MC using ampscript.please let me know is this functionality is achievable Regards Shiva
1
vote
0answers
45 views

Query String variables not showing up in URL after a RedirectTo

I am trying to set up a simple link, where the HREF points to a URL with a collection of query string parameters: Here's the <a>: Finally, after receiving the email, the URL I'm taken to ...
1
vote
1answer
34 views

Failed to convert parameter value from a string to a Int32 while all values are integers

I've encountered an issue while using a LookUp function in AMPscript in an email. I get the error "Failed to convert parameter value from a string to a Int32", when trying to LookUp a value using an ...
0
votes
1answer
36 views

How to run UpdateData and InsertData from cloudpage

I am creating a cloudpage that will use AMPscript to update data of one data extension and insert in another. I was wondering how I could make sure that these functions would run. So created the ...
0
votes
1answer
30 views

Ampscript loops to print from second data extension

I am using two data extensions, with a primary key in both as Id, first data extension contacts fields as name, email, brand, id. second one contains id, brand, delivers. One name can have more than ...
2
votes
1answer
698 views

Custom CloudPage Preference Center

I'm trying to build a simple preference center using Smart Capture. I'm trying to have the user experience be when the person clicks the "Unsubscribe" CTA in the footer it sends them to a Landing Page ...
1
vote
1answer
40 views

Dynamic date renders differently in email preview than send

We are dynamically setting text to show the last day of the previous month. This is the AMPscript in use: %%[ SET @CurrentDate = NOW(1) SET @Month = DatePart(@CurrentDate, 'M') SET @Year = ...
0
votes
2answers
33 views

AMPscript: 'For' loops duplicating content

I have an issue with my 'for' loop statement. It is producing duplicate content. My loop statement is as follows: /* look up top 3 destinations from preferred airport in EU only if preferred ...
0
votes
3answers
647 views

Show dynamic content block based on date and last update

I have created a dynamic content block, which is meant to be added to our email template. It is a top banner, which should only be shown if a customer have made updates to their basket within the last ...
-1
votes
0answers
43 views

BarCodeURL function AMPScript [closed]

I do not understand very well the pattern to use :( , can someone help me to generate a barcode with a control digit for 22 digits? /* CÁLCULO DEL CÓDIGO DE BARRAS CLIENTE */ SET @cod_cliente = "...
0
votes
2answers
408 views

Data Extension Lookup returns nothing

I have a DE called content with the following 2 columns - language | text I need it to return the text from the text column when the language is en This is what I have, It validates and runs but ...
0
votes
4answers
49 views

Ampscript Date formatting using format or formatdate not working

I have an ORDER_DATE attribute in my data extension which is of the text datatype. The date is in the following format mm-dd-yyyy. Now I want to convert this date into European format based on ...
1
vote
1answer
49 views

Generate GUID to existing records

It is possible to assign a GUID value to each existing record in a dynamic way? I'm recently add a hidden field with this value in a register form, but I need to assign a unique value to records that ...
0
votes
2answers
45 views

How to separate json response in different variables? [duplicate]

How do I separate this response in one variable, like I required from below response URL only in one variable? However, "BE050-A28" this value is dynamic in every response. { "vehicle": { "...
1
vote
1answer
53 views

Why does a simple multiplication DOES NOT work in ampscript?

<script runat="server" language="ampscript"> SET @x = 100 SET @y = 5 SET @output1 = @x * @y // Why this does NOT work! SET @output2 = Multiply(@x,@y) //And only this works!! ...
3
votes
1answer
63 views

Formatting Date and TIME in French

I followed this question/Answer to format date in French: AMPscript Date Formating for French Language in HTML emails Following this post, I would like to know how we should add the time to the date ...
0
votes
1answer
451 views

Data overwrite for journey builder personalization

I was building a new journey in journey builder this week and saw this message: Journey Builder captures a snapshot of the entry source data upon Journey entry >that is then used in email ...
0
votes
1answer
42 views

Editing an email, AMPScript does not stay in the spot I put it in after saving the email

I am having a weird, serious issue. I have an email with basic content. See screenshot - basically, the intent is to wrap if/endif around these content blocks to show the appropriate block. I've ...
1
vote
1answer
39 views

How do you share variable values across multiple blocks within an email?

I have a @variable1 defined in an email HTML content block that is defined. When the email iterator starts, I would like to use the value of @variable1 in a second HTML content block. How do I do ...
5
votes
1answer
346 views

AMPscript HTTPPost2 Parameters

I'm a bit lost with the HTTPPost2 function. According to the documentation, the fifth parameter is: used to contain string representation for the status of the HTTP request, such as OK. But this ...
0
votes
1answer
69 views

How to insert csv file record inside data extension from cloud page?

I have created a cloud page where I have provided browse button and after selecting CSV file I am reading CSV file in the script so there are 100 contact records in csv and I am sending WhatsApp ...
0
votes
1answer
33 views

Ampscript Error in SMS

I am writing an IF statement for subscribers that do not have a first name: %%[IF Not Empty(First_Name) THEN]%% %%=Concat(ProperCase(First_Name)," ",you)=%% %%[ELSE]%%You%%[ENDIF]%% I am getting an ...
3
votes
3answers
50 views

Show dynamic content based on percentage

I want to show a certain contentblock randomized to new subscribers. We want to ask them to leave a review on a certain website (or websites). Though, some review websites are more important than ...
0
votes
1answer
20 views

Ampscript - Dynamic UTM paramters

I've figured out how to put in dynamic utm paramters to append to all links in an email with the below ampscript. %%[ Var @campaign, @pcode Set @campaignID = "%%campaignid%%" Set @pcode = "%%pcode%%"...
0
votes
1answer
33 views

Cloud Page .ics file unable to be opened in safari

I have an email with a button that has ampscript RedirectTo(CloudPagesURL(x)). After redirecting, it automatically downloads .ics file. I am having problem when trying to get the ics file to download ...