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
4
votes
1answer
130 views

claimrow() is claiming two rows for each subscriber when used in a journey

This one has me stumped. I have the following AMPScript in an email: %%[ var @em, @couponRow, @couponCode if _messagecontext == "PREVIEW" then set @couponCode = "XX TEST XX" else set @...
0
votes
2answers
44 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
2answers
72 views

write some AMPscript to skip a record if its empty

I have a data extension with a CustomerId(PK) that has multiple Productid's as Productid1, ProductId2, ProductId3...ProductId10. Some of the Productid's are empty for some Customers and I'm trying ...
0
votes
1answer
32 views

Web Analytics Connector only on whitelisted domains

After enabling Web Analytics connector I have noticed some of our external links (not on our own website) break, is it possible to only allow associated parameters to be appended to "authorised/...
0
votes
1answer
77 views

Using AMPScript loop for generating content in an Email [closed]

I have defined a Generic Template Email using AMPScript. So all the content will be dynamically included when sending the Email. I am using LOOP sentences in my AMPSCript code. When sending these ...
0
votes
0answers
26 views

How to create triggered emails with Magento connected to Salesforce?

We currently have welcome newsletter, welcome account, password reset, order/shipping confirmation, unsubscribe triggered emails from dotmailer using the connection to Magento . The Magento generated ...
0
votes
1answer
182 views

Dynamic Image in Content Builder using Ampscript

I have 1 000 images stored in a file, in Content Builder. Each image corresponds with a user. Image names are the users' id. When an email is sent to a given user, I want his photo to be displayed ...
0
votes
1answer
24 views

AMPScript LookUp not retrieving any value

I've added a Lookup in my email to retrieve the language of the customer but, despite there is data, the function doesn't retrieve anything (I tried with different values or Data Extensions but with ...
1
vote
1answer
31 views

Exclusion Script for Domain in Marketing Cloud

I'm looking to do an exclusion script on 2 domains. Here's the current script, but I'd like to add another domain. domain(Email) == "noemail.com" Would I do it like this? domain(Email) == "...
0
votes
2answers
55 views

One-Click Unsubscribe that was working earlier is not working now

The below code was working perfectly but don't know what happened the code is not working now. When I'm clicking the unsubscribe link it is not updating the values. %%[ var @jid var @...
0
votes
2answers
49 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": { "...
3
votes
3answers
63 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
44 views

Displaying a cloud page for sign up in external website

I have created a sign up cloud page in marketing cloud and I want that page to be embedded in some other website. I know there are options like iFrame or DEmanager but iFrame are not that good for ...
1
vote
1answer
45 views

If/else amp script logic for a custom landing page

we are currently in the process of developing a custom preference centre via cloud pages. In one of the tabs we ask users for region/travel preferences. We have 6 checkboxes corresponding to 6 regions....
3
votes
1answer
40 views

How to use Journey Data to personalize Email when using Salesforce Entry Data

I want to create an Email which contains the first name of the person to whom the mail is sent. I am using the journey builder through which I am sending the mails and my entry source is Salesforce ...
1
vote
1answer
50 views

Request Parameters from url through iframe with Ampscript [closed]

I have a landing page lead form created in Salesforce Marketing cloud which we're hosting on our Wordpress website via iframe. Within the lead form we are pushing all new leads to individual ...
0
votes
1answer
36 views

Is there any way to pass data extension values to salesforce CRM

I have a Data Extension that stores user details like FirstName,LastName and Email. Is there any way that allows us to pass these values to our Salesforce CRM. Maybe as a record in Contact?
0
votes
1answer
58 views

CloudPage Picklist Values from Data Extension using ampScript

I am experimenting with having a "Preferred Channel" picklist field on a Custom Preference Center Page hosted on CloudPages and would like to restrict field values to a specific subset of picklist ...
2
votes
1answer
98 views

SSJS equivalent of DecryptSymmetric

Knowing that we have EncryptSymmetric and DecryptSymmetric in Ampscript, both with the ability of referencing password, vector and salt, from Key Management - is there anything similar in SSJS? If a ...
-1
votes
1answer
55 views

How to remove a record from a publication list using scripting [closed]

Can please help me to how to remove a particular record from publication using scripting(ssjs/api ampscript) Thanks, Shiva
0
votes
0answers
26 views

Dynamic Sender Profile Emails not received properly

I have the variables(@FromEmail and @FromName) printing in my email body properly, but when I send the email it defaults back to my defaul From Email and Name. I have this code in my Sender Profile: ...
2
votes
1answer
82 views

Dynamic Flag for Deep Linking MC-Deep-Link

We use the "mc-deep-link" tag in our href to ensure we are either pushing our customer into our App environment or to our website if the app doesn't support that specific link. All our links are ...
1
vote
3answers
94 views

display star rating based on score

I have a record of Score in a DE which is recorded as number and I want to create a star rating display in the email based on the score number. e.g if the score is 3.6 show 3 stars and a half or if a ...
0
votes
1answer
40 views

Retrieving checkbox values from DE in cloudpage

Maybe it's basic, but I simply can't figure this out. I have a cloudpage which I would like to use as a preference center, and therefore I need to retrieve the values of checkboxes. True/False = ...
0
votes
1answer
64 views

CreateSalesforceObject function not working

I wrote the below code to store the form information directly into the salesforce contact object but it is not working. The cloud page is showing the 500 - Internal server error. %%[VAR @fname,@lname,...
1
vote
0answers
35 views

Organizations that send “Advance Notice” or “Prior Notice” to internal teams, how do you do so with Marketing Cloud?

At my organization, we need to send communications 24 hours ahead of time to a large number of people within the organization, aka Advance Notice. I'm currently having difficulty finding a method of ...
2
votes
1answer
97 views

Handling multiple regex matches in Ampscript

Given this string: SET @text = "<a href=""https://salesforce.stackexchange.com""target=""_blank"">Salesforce</a> <a href=""https://stackoverflow.com"" target=""_blank"">Everything ...
1
vote
1answer
49 views

Update All Subscribers Profile Attribute

I want to update an 'all subscribers' custom attribute in the parent bu to match what is in my sending DE in my child unit. Currently i have a custom attribute in 'all subscribers' called '...
1
vote
0answers
51 views

Is it possible to have AMPscript fetch the HTML of an email (prior to send) and automatically place it in an HTML content block?

I am wondering if I have an email, already built out with content in place, if I would be able to have AMPscript automatically pull the HTML of the email into a separate HTML block? I then would like ...
1
vote
1answer
41 views

Force ampscript to display result in editor instead of switching to preview

We have created a piece of ampscript that retrieves the images url from a data extension based on the SKU of a product. The SKU is injected in the code. Everything works but the ampscript loads once ...
1
vote
1answer
99 views

Issue with Radio Button with text input

I am creating a cloudpage on web studio and using Radio Button to select the donation value to create a new opportunity (and a contact if not already exists) having the selected radio button donation ...
0
votes
1answer
89 views

Preview links and “View as Web Page” Solutions?

At my company, we need to send out preview links within the organization internally before a communication is sent out. In our past platform (MailChimp) the "View as Web Page" option allowed us to ...
0
votes
1answer
128 views

AMPscript for Radio Button with text input

I am stuck at handling the value of radio button with text input. The radio button with static values are handled correctly. Here is the AMPscript for 1000, 500 and text input. Can you please help on ...
0
votes
2answers
68 views

AMPScript Radio Button

I want help in AMP script for below scenario I am creating a donation page on CloudPage in which there are multiple radio buttons for donation amount i.e. $1,000, $500 etc and so on. I want to ...
0
votes
2answers
88 views

AMPscript Test Send Error

New to this so ELI5 please. I'm trying to test an email with the following script but the test email never arrives to inbox (while selecting a test Data Extension). %%[ SET @Phone = '123456789' SET ...
4
votes
1answer
96 views

Journey builder email send activity exclusion script issue

I am trying to use an exclusion script in an email send activity to inject data to a data extension. I have no intention of sending the email. I have tried with both upsertDE() (the email send ...
0
votes
2answers
102 views

How to Generate Access Token Using Ampscript

Updating my question with new error code. I tried the below code to generate Access Token. But I am keep getting an error. orted_grant_type","error {"error":"unsupported_grant_type","...
1
vote
1answer
51 views

AMP script create new opportunity based on a unique contact record validated by email id

I want help in AMP script for below scenario From the web studio cloudpage the new contact record should be created in sales cloud. Contact duplication should be avoided based on unique email id. If ...
1
vote
2answers
150 views

Get first and last day of the week in Ampscript

how can you get the first and last day of week. But my first day should be Monday and last day should be Sunday (I should follow the UK timezone). Here is the code from Gortonington. %%[ SET @...
0
votes
0answers
64 views

Replace() AMPscript is not replacing anything!

We are nesting AMPscript into a content block to insert products into email. The AMPscript is pulling from a Data Extension where apostrophes are escaped as &apos; What we're trying to do is ...
2
votes
2answers
42 views

dynamic subject line extraction

We sent an email which has a dynamic subject line using Ampscript logic. is there a way to find out how may people opened subject line A vS subject line b? when checking the job table it just shows ...
0
votes
1answer
38 views

How to add content to above email template assigned to Triggered Email

I have managed to initiate the Triggered Email using AMPscript in a Cloud page. Is there a way to pass in text content into the Triggered Send above the email assigned to the Triggered Email ...
2
votes
0answers
37 views

Assign using Active Assignment Rule being ignored with UpdateSingleSalesforceObject

The AMPscript function UpdateSingleSalesforceObject ignores Assignment Rules when Leads are created or updated. Is there any way to assign the assignment rule when a lead is updated via ...
2
votes
0answers
31 views

How to setup programmatically the background color of a marketing cloud Layout block

I am struggling with the possiblity of configuring programmatically the background color of a Layout Block that I have in Email Studio. I don't find the possibility of doing that using AMPSCript. It ...
0
votes
3answers
74 views

retrieve content blocks in landing page based on data extension attributes

I have one email which has link to cloud page/ landing page. the URL is passing email address in url parameter and then ampscript is fetching all values from DE to the LP. But I am stuck with ...
1
vote
1answer
137 views

Product Recommendation display in email

I'm trying to build a product recommendation section in our emails but as I'm very new to AMPScript I'm not sure if I'm on the right path so if you can give me some guidelines would be much ...
1
vote
1answer
40 views

SmartCapture: making pre-populated fields non-editable?

We created a SmartCapture form on a Marketing Cloud cloud page to be used for a data enrichment campaign. As part of the design, we have 2 pre-populated fields: physical address and account ID. Both ...
1
vote
1answer
54 views

Displaying the publication list so the user can opt-in from a cloud page

I want to create a cloud page where it displays all the publication lists and from those user can select and subscribe in any of the publications.Just like in the subscription center. As I am new to ...
0
votes
1answer
163 views

Custom Unsubscribe page using Ampscript in cloudpage

I have used the below code for unsubscribing the user. It is working fine when I am passing the CloudPageURL() in the footer but when I am passing it in a cloud page it is not working. I want to ...
0
votes
1answer
55 views

AmpScript for PrePopulate based on previous submitted values

I am trying to build the backbone of a form where I will have the values in the form pre-populated based on previous submissions. If there is a submission in my DE then I want the values from the last ...

1 2 3 4 5 44