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
2answers
46 views

Cloud Pages - API request inside of an IF statement

I'm using the following code in a Cloud Page to submit an HTTP Post request. I was able to get the Script.Util.HttpRequest() methods to work on their own. But now I want to only submit the request if ...
0
votes
1answer
27 views

ClaimRow function not working when using twice in the same Email Send

I am using regularly the ClaimRow() function in many of my sends for assigning coupons to my subscribers. As I have to be able to assign more than one coupon to my subscribers from different sends, I ...
0
votes
2answers
42 views

Ampscript SSJS Error Internal Server Error

I created a ampscript to embedded into cloud page to update the object in Salesforce. Here is my Cloudpage landingpage: <!doctype html> <script language="javascript" runat="...
0
votes
0answers
29 views

How to get html form input hidden value which is rendered from Javascript on click function to lookup DE and pre populate form selections

I have a cloud page A that has Javascript and another cloud page B which has HTML, AMPscript and the cloud page A is called in cloud page B as src (<script src ="%%=Cloud Page B's URL=%%"&...
0
votes
1answer
39 views

One-to-many insert/upsert from landing to separate DE's

I'm bulding a preference center and having trouble with writing into two separate DE's. We have two DE's: Newsletter_Subscribers (EmailAddress, FirstName, LastName, OptIn, Country, IPAddress, ...
0
votes
0answers
34 views

SFMC AMPScript Lookups in Multi Org Child Business Unit

Trying to use AMPScript to do a lookup in an email to populate various data. I'm using the synced data extension name, which because I'm using a multi org connector I'm getting this error message. The ...
0
votes
1answer
49 views

IF ELSE Statement in AMPScript

I have problem with IF/ELSE statement in Ampscript ,as it is not going through else statement I have created a DE for couponcode Claim coupon DE details(CouponCodeRedeem) CouponCode - CouponCode ...
0
votes
0answers
22 views

AMPScript - HTML Formatting for Dynamic Table (Issues with Outlook 2013, 2016 Windows 7 and 2019)

I have an email where I need to display tiles dynamically based on conditions. Maximum 8 tiles need to be shown with maximum 2 tiles in 1 row. I have created only 2 tables for the tiles and have ...
1
vote
1answer
54 views

Read all request headers on CloudPage server side without knowing their names

I need to store whole HTTP request made to a CloudPage for audit purposes. I'm able to log everything besides headers. I'm unable to read all of them with ampscript or SSJS without knowing their names ...
0
votes
1answer
36 views

Are rows in AMPscript the same as Arrays in JavaScript?

newbie to AMPscript and code in general. Currently learning JS. If an Array is a variable that can hold multiple values at a time is that the same as a row in a DE/AMPscript? E.g Contacts can include ...
0
votes
1answer
40 views

Set value based on Checkbox being True or False using AMPscript

I am trying to display a value of "Yes" or "No" depending on if a checkbox is checked. If checked, I want to display "Yes" if not, display "No". I have tried a ...
0
votes
1answer
49 views

using AMPscript variable instead of the target Data Extension's name in Guide Template Language dataobject type list

I am building an email in Content Builder that will show GTL variables but I want to set an AMPscript variable to the target Data Extension’s name. I find that I can use AMPscript variables in the GTL ...
0
votes
1answer
28 views

Passing value from one DE to another upon send

Below is the DE i am sending to. Its called Power_NovaMep Below is the Target DE called SendLog I want the value of Ref_no from the Power_NovaMep DE go to the Send_Ref column in the SendLog DE when ...
0
votes
0answers
10 views

Pulling variables from multiple rows for a unique user ID via AMPscript

I'm trying to display dynamic content in an email for users who completed modules on the client's website. For each module completed, there is a Badge_ID that is added to the data extension "...
0
votes
0answers
22 views

Fetch failed loading: POST

I am building a form on a Landing page, and I keep running into an error when I'm passing the javascript to the processing page. In the error console, I see the following: Fetch failed loading: POST &...
0
votes
0answers
15 views

Suggestion please, How to include test data extension while sending from journey

I'm looking out for your suggestion or concept to work on this task. Is it possible to include contacts of specified data extension to target data extension using AMPscript and send them emails to ...
0
votes
1answer
29 views

Column is shifted to right in case of odd number of tables

I have 2 tables to be rendered in my email based on conditions and loops. In case of even number of tables, everything is properly fine. However, in case of odd number of tables, the 1st table in the ...
0
votes
0answers
24 views

Using Ampscript I am trying to capture two different parameters fro two different links in the same code

I have two links out of which one has account Id of salesforce and one has Sent email id of salesforce. Now the requirement goes like based on the the Ids i should be able to capture the Email address ...
0
votes
0answers
20 views

Get SMS template name using ampscript

Is it possible to get the mobile connect SMS template name using ampscript? I cannot seem to find any article that has this use case though I found something for email using the Email data strings. I ...
0
votes
0answers
14 views

How to redirect Smart Capture Form Submit depending on radio button selection

I have a form in CloudPage with a question based on radio buttons, the possible answers are YES and NO. I need to show a message based on the VALUE (YES or NO) selected by the customer. How can I ...
0
votes
2answers
32 views

Ampscript-Populate first Thursday of month in email marketing cloud

We need to populate first Thursday of month using Ampscript in email. Ex:"Thrusday,july2,2020" But my below code is not working. Pleasesuggest what went wrong here. I am not aware of ...
0
votes
0answers
23 views

If statement showing true despite the condition not being met

I am trying to see if a chosen date is between two other dates. My If/Else statement however is always showing true and displaying "Current date is before week27" despite the condition not ...
0
votes
1answer
31 views

Personalisation String in Inline If statement

Does Inline If not work for personalisation strings? I have the following code: http://www.website.com?utm_source=sfmc&utm_medium=%%=IIF(NOT EMPTY(%%Variable1%%), %%Variable1%%, "")=%% Does ...
0
votes
1answer
30 views

Marketing Cloud Ampscript to output latest data within time period issue

I have the below AMPScript that isn't quite right. What i want it to do is output data form a data extension that was added to the Data Extension within the last 24 hrs. I want to add the code to an ...
0
votes
1answer
32 views

Get Journey ID of SMS send using ampscript

I need to get the journey ID from SMS send so I created a code that should get the SendJobId set @jobid = AttributeValue('SendJobID') However I cannot retrieve any values. I was hoping to get the ...
0
votes
1answer
32 views

Show/Hide email content based on Data extension attributes

I have 2 pieces of text content I would like to make 'Dynamic' in Salesforce Marketing cloud content builder. 1) CUSTID: I currently have a data extension column called 'CUSTID', and in the email I ...
0
votes
1answer
40 views

Trying to use Checkbox in AMPscript code to determine field value

I am trying to use a Checkbox to determine the value based on field value from another object. There are three outcomes, depending on Account Type (Account Object) and Checkbox (Custom Object). This ...
0
votes
1answer
42 views

UPSERT from Cloud Page to Sales Cloud

Is there a way to do an upsert from a CloudPage to a Salesforce Sales Cloud Object? In this case the need is to update the Account Object. Scenario: A new subscriber is created in marketing cloud ...
0
votes
1answer
21 views

Multiple records causing AMPscript to pull first record

%%[ Var @EventName, @EventStartDate, @EventID, @FirstName, @SubscriberKey, @EventEndDate SET @SubscriberKey = AttributeValue("_subscriberkey") SET @EventID = Lookup("ContactToOnlineEvent","Event ID",...
0
votes
1answer
41 views

Ampscript to write triggered send data to another DE

I have a triggered send set up and it works perfectly. Then in the triggered email there is a cloudpagesurl link with all of the data from triggered send DE. Cloud page redirects to a new page called ...
0
votes
1answer
21 views

Keep portfolio form when using GetPortfolioItem function

I used GetPortfolioItem function to refer the portfolio (text file) from Email studio to my Email content in Content Builder. But it seemed it couldn't keep its original form in preview mode. Exactly ...
0
votes
1answer
38 views

Is there a simple way to alphabetically order incoming string value separated by a comma using Ampscript in SFMC?

%%[ <br><br> VAR @segmentProduct, @queryparams SET @segmentProduct = AttributeValue("SEGMENT_ENTITLEMENTS") SET @queryparams = BuildRowSETFromString(@segmentProduct,',') ...
0
votes
1answer
36 views

Ampscript Execution

I have an ampscript with CreateSalesforceObject code, this code creates a record on service cloud for every email sent by marketing cloud. My question is, can someone clarify the trigger point of ...
0
votes
1answer
27 views

Is there an Ampscript function that counts occurrence of a letter in a string?

I'd like to read the total number of comma (,) in an incoming string.
0
votes
2answers
50 views

How to trim a particular word from a string and store it? [closed]

I am storing the URL given below in a field in DE: https://www.tbd.com/tbd-bags/?utm_source=sfmc&utm_medium=email&utm_campaign=_4in1tbd_20170421&utm_term=nav4+bags&utm_id=9087&...
0
votes
0answers
19 views

Exclusion Script for Journey Builder with Personalization Strings from Data extention?

We would like to filter the email sends in a journey using specific filed on the DE, which is the Start of an Entry Source. The thing is, we cannot use any of the fields in the documentation: SFMC ...
0
votes
0answers
22 views

Ampscript - get campaignmember first name From Salesforce on a email template

We use interaction ‘Salesforce email sends’ to the recipients : campaign . On the email template we want to customize with campaign member first name using AMPScript.is this possible?
0
votes
0answers
27 views

Subscriber Preview for SMS

When creating an SMS, it seems that we can preview the SMS and the personalization by choosing a Data Extension and using personalization string from the data extension (%%DE_Field%%). However, it ...
0
votes
1answer
18 views

FormatDate issue with added time

I am having an issue with formatting a date field into a 24 hour time. Below is the FormatDate function I have in my AMPscript. My expected result would be to look like this: 19/05/2020 19:00 - 20:00 ...
0
votes
2answers
87 views

Opt-in SMS keyword with AMPScript + Sales Cloud

Actually what I would like to implement is that whenever a subscriber replies JOIN to the short/long code he/she will be opted-in to all of the keywords under that code. is that possible? What would ...
0
votes
1answer
38 views

How to using AMPScript in Web to Case form

I have a W2C form that need to change the ContactName text field to lookup field that will contain all the contacts in our CRM org and I try to using AMPScript to do it. However, I want to know is ...
0
votes
0answers
9 views

GroupConnect Personalization String

I would like to create a simple personalization in Line messaging (GroupConnect). Path used: Mobile Studio > GroupConnect > Create Message > Outbound > Text + Emoji In contact builder, there is a ...
0
votes
1answer
75 views

Parsing JSON in email using SSJS and Ampscript

This is my JSON request : { "definitionKey": "SSJSTEST19", "recipient": { "contactKey": "007", "to": "sourabxxxxx", "attributes": { "EmailAddress": "sourabxxxxx", "...
0
votes
1answer
56 views

LookupRows by ID, with multiple Ids

Within Salesforce Marketing Cloud, I have an email template. Every day the email will go out. The email recommends up to 3 jobs posted on our site, to each Contact in the data extension. This data ...
0
votes
1answer
35 views

Best Approach for tracking File downloads and Triggering AmpScript on File Download (Marketing Cloud) [closed]

We are creating a Journey in which we want to create a SF Task after a file was Downloaded. This is a typical B2B scenario, and can easily be achieved with Pardot. But what's the best approach to ...
0
votes
1answer
37 views

Passing Constant Ampscript Variable to CloudPage Smart Form

I created an email with a CloudPage button link. We will have different emails leading to this cloudpage which contains a smartcapture form, but I want to track which email drove the subscriber to the ...
0
votes
1answer
25 views

Nested function using inline AMPscript

I'm new with AMPscript. I'm trying to make my AMPscript look better Original script: %%[ var @pointsBalance, @memberLevel set @pointsBalance = AttributeValue("Total") if @pointsBalance > 1000 then ...
1
vote
1answer
72 views

Target DE and Destination DE the same?

I have a DE with three columns with values and two with no values. I want to send an email to this DE. The email contains a link to a Cloudpage landing page with a form & as customers fill the ...
0
votes
1answer
74 views

Best approach to creating a task in Salesforce based on Email Click - Marketing Cloud

We are building a journey in which we are sending an email with a Question. Instead of linking to a survey (e.g. CloudPage), to keep it simple, we thought the best way is to ask the question in the ...
0
votes
2answers
36 views

Trying to use alternate field if first field is blank using AMPScript

I am using the following code to select a contact. If Resort General Manager field is blank, then use Resort General Manager field. I have tried a couple of variations, but cannot display Regional ...

1
2
3 4 5
48