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

SSJS try and catch and Ampscript raise error

At the moment our emails are using a try and catch SSJS wrapping and stringify to log the error into a DE. The problem is that when the error occurs the error is emailed to the customer. Support ...
0
votes
1answer
21 views

Don't show contentblockById using Ampscript

I use the following AMP to decide which contentblock I want to show. %%[ /* UTM code genereren */ SET @Huidig_Pakket = AttributeValue("Huidig_Pakket") /* Kies en koop *...
0
votes
0answers
16 views

Not able to identified Business Unit MemberID (MID) using SSJS in cloudpages [duplicate]

We are not able to identify Data Extensions based on Business unit MID , Every time system is picking Data extension from Dev BU even we try cloudpage URL from Staging BU (456789876) still System ...
0
votes
0answers
22 views

decrypt jwt token with ssjs or ampscript [closed]

i have a problem with jwt token and how we can decrypt it with ssjs and ampscript to retreive all the information there how can we decrypt jwt token returned by azure authentification with ssjs or ...
0
votes
1answer
28 views

AMPscript LookUp search records for specific days

I have a date format in the DE that includes minutes and seconds (4/09/2021 11:45:18 AM). I only need to search and show the records of a certain day (format; MM / D / YYYY). DateParse and FormatDate ...
0
votes
1answer
34 views

Is there a way to populate a link's title in the utm parameters? Similar to %%linkname%% which populates a link's alias

We have Web Analytics Connector (WAC) set up in Salesforce Content Builder. In the email message Properties tab, there are slots to input utm parameters which will append to the end of all links. They ...
0
votes
1answer
36 views

How to Lookup a Primary Key, if value is not empty, redirecting to a specific link

I would like to request help on my code. Hope you understand my question. This form will be shared public / social media I created a cloud page with amp script. Values on my smart capture are EMAIL (...
0
votes
2answers
30 views

Check the Subscriber Consent Before sending an Email

When any Email Campaign is send from the Marketing cloud, I want to check the latest Subscriber Consent for Email_Optin from the Master_lead DE which is Sync with CRM. If the Email_Optin is not true ...
0
votes
2answers
26 views

How to check if data in data extension is present or clear by someone accidently using SSJS?

We are adding below code to check if Data extension is present or someone has deleted accidently , as we are fetching content ( with only one row) from DE to display on a cloudpage if someone delete ...
0
votes
0answers
26 views

InsertDE to UpsertDE Syntax changes help

I am not fully confident with my dev abilities and am attempting to change some code to populate a DE with UpsertDE logic instead of InsertDE. I have the following being used for InsertDE, and need ...
0
votes
1answer
20 views

Add date of submission to Cloudpages form/data extension

I currently have a page set up in CloudPages that includes a form. When someone fills out the form, the information goes into a saved data extension. Is there a way to automatically include the time ...
0
votes
2answers
30 views

How to tackle with unique URL (with qs parameter) forwarded by one customer to another

When we allow our customers to redirect to cloudpage URL from Email link using cloudpagesURL() AMPScript function there is a unique qs parameter generate for each customer and if that particular ...
1
vote
1answer
46 views

Attributevalue AMPscript function is not working as expected

as per the detailed explanation of question and answer in this post. I am still not able to set value in cloudpages using AttributeValue AMPscript function We can use AttributeValue AMPscript ...
0
votes
0answers
13 views

How to append separate parameter (&Id=123) along with query parameter (generated using CloudPageURL ampscript function) in Cloud page URL [duplicate]

From email link we are passing customer firstname ,email using cloudpageURL function also we need to pass one more parameter after querystring (generated by cloudpageURL ampscript function) using ...
0
votes
1answer
19 views

How to set client-side JavaScript variables in an AMPscript expression?

I want to retrieve some data from a form via JavaScript, and have them in JavaScript variables const value = document.getElementById("my-field").value; After that I want to pass this ...
0
votes
1answer
20 views

How to encrypt sent data using the XMLHttpRequest and retrieve it via AMPscript?

Our client is looking for a preference center where there is no page refreshing, the user click on submit and a message pops up I did not do this before, so I made an example to achive this, with a ...
0
votes
1answer
28 views

Marketing cloud page insert row using onclick event

I have this image <img src="%%=v(@link)=%%" onclick="registerClick()"> and the following function function registerClick(){ alert('click'); %%[ outputline('OUTPUT') ]%%...
0
votes
1answer
37 views

Can we identify Marketing cloud memberID using SSJS as we do in AMPscript?

Can we retrieve and identify Marketing cloud memberID as below using SSJS platform library as we do in AMPscript? IF memberid == 7765150 THEN SET @de = 'QA_DE' SET @url = 'https://pub....
0
votes
1answer
28 views

Fetch the Lead Owner name on the Cloudpage using Ampscript

I'm working on the Contact Us page, I want to fetch the lead owner from the Lead table on the cloud page. When i am trying to fetch the Lead Owner its show me 500 internal Error. SET @subscriberRows = ...
0
votes
0answers
22 views

What is the sequence of scripts execution in Marketing cloud ? ampscript executes first or SSJS?

What is the sequence of scripts execution in Marketing cloud ? ampscript executes first or SSJS ? or it will be top to bottom ?
0
votes
0answers
34 views

Decrypting AES in AMPscript

We are using below php code to encrypt value 'John' using AES encryption and the encryption value that's getting generated for it is - 'SYKRYFHeCijBb8SSJiPxaw=='. When I am trying to decrypt this ...
0
votes
0answers
17 views

SMS has sent the user ID to be written into DE

We are using cloudpage to track SMS. We use cloudpage to track which users have clicked the link in the sending SMS. If the user has clicked, we will write the user information into a new De. We use ...
0
votes
1answer
23 views

RequestParameter in Ampscript and how it is used?

We have a html form and from this form we fetch email address. For example, the form input field looks like this, <input type="text" name="EmailAddress"> Then there is the ...
1
vote
0answers
40 views

HTTPPost2 does not work, but in Postman works the Post

I tried a simple HTTPPost2 to call a web service, but I got the 500 error. %%[ var @payload, @postRequest, @response, @responseRows set @payload = '{"KEY":"dataXml", "VALUE&...
0
votes
0answers
47 views

How to retrieve more than 2000 records using Script

Hi I have the following script when running it I can get around 5000 records but i have around 35k records in the DE Can you please tell me how can I get all the rows from the DE My data is like this ...
0
votes
0answers
13 views

Security in Cloudpages when using Java Script flow frame-work to call app and customer can input their details on that app called by Javascript

We are developing a cloudpage (Landing page) in marketing cloud and on that landingpage there is a button called "Get Started" so once customers land to this cloudpage they can click on &...
0
votes
1answer
28 views

Hiding sensitive link data in url with AMP?

Having a problem when clicking the manage preferences link it cannot show the tracking or PII information (email address) in the browser. Have tried using Redirect and URLEncode to limit what shows up ...
0
votes
1answer
21 views

Configure View as Web Page link domain

I have two business units, let's say ABC and DEF. I want the %%view_email_url%% to redirect to http://view.email.abc.com/? For the first BU and to http://view.email.def.com/? For the second BU. How ...
0
votes
0answers
20 views

Splitting a single DE value into multiple variables using IndexOf() and Substring() to print in multiple email <td>'s [duplicate]

I'm struggling to figure out the best approach to split a single DE value separated by a pipe delimiter into multiple variables. The value looks like this: This is some text| This is some more text| ...
1
vote
1answer
21 views

Can't display my rows from my data extensions?

I have two data extensions, books & subscribers I am trying to extract the list of books as well as the name of the user assigned to each book via the id ( subscriber id ) This is my code : <...
0
votes
1answer
34 views

Fetching and displaying titles, statements , image URLs etc. from data extension on Cloudpages using multiple html blocks

We are using multiple HTML blocks in a cloudpage (using new contentbuilder while creating cloudpage) and in each HTML block we are fetching titles , statements , image urls from Data extension ( one ...
0
votes
1answer
36 views

Add personalization to an email from a secondary DE

I would like to add personalization to an email from a secondary DE. First of all, we have 2 DEs involved: The first is the one that we are targeting customers and has 2 Primary Keys. The second DE ...
1
vote
1answer
37 views

Feeding Subject Line to Title for View as Webpage

I'm trying to use ampscript to feed the subject line to the title tag on the webpage that loads when clicking on VAWP. -I have the title tag set as <title>%%=v(@Subject_Line)=%%</title> in ...
0
votes
1answer
36 views

Cloudpage performance by calling multiple content blocks using contentblockID AmpScript function in html blocks [closed]

We are developing a cloudpage using multiple html blocks ( Using new content builderfunctionality) , so is there any performance issues if we create code snippets in content builder and called those ...
1
vote
1answer
28 views

Return Values for Single Row when when multiple rows are returned (LookupRows)

I'm currently trying to figure out how to return values from a specified row when multiple results are returned: For this case I'm going to show an example from ampscript.guide since my code is very ...
0
votes
1answer
38 views

HTTPPost2 replaces + symbol with a blank space if we use it in an email address

In one cloud page where I am using AMPScript to make a HTTPPost2 call to another cloud page and try to retrieve values using SSJS like this: var email = Request.GetFormField('emailaddress'); If ...
0
votes
1answer
29 views

Use conditional url for form action

I have a cloud page with a form. When a customer submits this form they are directed to the Thank you landing page. I have two versions of the Thank you landing page. customers who rate us greater ...
0
votes
1answer
20 views

get image size properties with SSJS

What am i trying to do: I'm setting up a responsive e-mail template in Marketing Cloud using images from a datafeed. The image url's are successfully retrieved from the datafeed with AMPscript. ...
0
votes
1answer
32 views

Dynamic content blockID to DE using ampscript

I am using dynamic content with rules in my email sends. Is it possible to use ampscript to log which content blocks a given customer has been exposed to? I've trying to figure something out using ...
0
votes
0answers
18 views

Look up existing Subscriberkey on Form Submit

I am using a cloudpage which looks at subscriber key once they click a link in the email but I realize this route is not preferred THey want a link on a site which then links to the cloudpage which ...
1
vote
2answers
54 views

LogUnsubEvent in custom landing page

we have created a custom landing page in Marketing Cloud that we are using as a preference centre/unsubscribe centre to update marketing cloud all subscribers when contacts unsubscribe & Sales ...
0
votes
0answers
36 views

AMPSCRIPT lookup rows - how to limit results to most recent

Very new to lookuprows. No idea what I'm doing. I have a form that's set to append. And then I have an email with lookuprows that's scheduled to send me results daily. However, I want to limit results ...
0
votes
1answer
19 views

Ampscript getting error

I'm getting below error while working on ampscript, tried to de-bug it, but not sure what I'm doing wrong There is an error in your email. Please contact your customer service representative. Error ...
0
votes
0answers
20 views

Can you delete extra space using ampscript if conditions are not met?

We are creating an email that will populate a list of names for the recipient. However, each list will be a different length. Is there a way to delete the extra space created if the list only has 1 ...
0
votes
1answer
33 views

Localised currency Email Recommendations

I'm facing some difficulties around the email recommendations and especially to make them localised. I need to show a different currency for Denmark (kr) then the currency for France (€). I have the ...
0
votes
0answers
38 views

SFMC Push notification to run ampscript contentblock by id and SSJS

I want to send a push notification to add points to an external system via an api call to mulesoft. The push notification is sent via the journey that is triggered via an api call. I have a content ...
4
votes
1answer
53 views

How to claim the same row without claiming a new row for already claimed customers using claimrow() in SFMC?

I am trying to implement unique coupon codes in SFMC. I have created a data extension - Unique_Coupon_Codes like this, This is the code I have written %%[ if _messagecontext == "PREVIEW"...
4
votes
1answer
59 views

Limit code execution for BCC send

Due to compliance reasons, I'm required to BCC an archive email address for each SFMC send. I have below code snippet in one of the emails. SET @caseCreate = CreateSalesforceObject( 'CaseComment', ...
0
votes
1answer
42 views

Three FOR loops in ampscript after reading from XML

I have an eReceipt issue. I am able to get the nested loop to work to display the promo amounts and descriptions when there is only one promo per item purchased. Where I am stuck is trying to add a ...
1
vote
2answers
32 views

Outputting the value of dynamically created AMPScript variables

In an email, I am using SSJS (I know, frowned upon) to parse out a JSON string. %%[ var @resourceCount ]%% <script runat="server"> Platform.Load("Core","1"); var ...

1
2 3 4 5
56