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

Basic IF/THEN Ampscript question

I have a data extension attribute called MemberTier and the value can be one of 3 possibilities, S,G,P, or Silver, Gold, Platinum. I want to take the abbreviation and translate that into the full name ...
0
votes
1answer
31 views

MC Journey RowCount and lookup function help, please

my Marketing Cloud (MC) Journey Data Extension(DE) is set to SUBSCRIBER RELATIONSHIP ==CampaignMember:Common:Id. this DE can have the duplicate CampaignMember:Common:Id with a unique CampaignMember:Id....
0
votes
1answer
21 views

Best way to target 30 different options using ampscript

Looking to create an email with 30 different options for an image. Each image will have a value correspending from 100-130 and there can be up to 3 images per contact in the email - so 3 possible ...
0
votes
0answers
15 views

Ampscript code to check if column exists in data extension [duplicate]

In our old templates we pull the customer number from the sendable data extension, named [Account Number], we have a secondary template for sends that do not need a customer number or for leads that ...
-1
votes
1answer
45 views

AES Encryption in Ampscript

I want to encrypt a string using AES encryption in ampscript. I am using EncryptSymmetric function that uses AES algorithm as mentioned in the following documentation : https://developer.salesforce....
0
votes
1answer
42 views

Redirect to Cloudpage using Page ID on a Lookup script

Hi All, I would like to request assistance on how I can redirect to a page using the CloudPagesURL value on a Lookup script? I'm not sure if my code here is correct? %%=Redirect('%%=CloudPagesURL(400)=...
1
vote
1answer
19 views

Preheader in SFMC has a known bug when it comes to using ampscript, but

For SFMC there exists this known bug: https://help.salesforce.com/s/articleView?id=000321251&type=1 I understand how to handle it, putting things above the body-tag, but now I have a preheader ...
1
vote
1answer
42 views

Concat Smart Capture values going to URL upon submission

I would like to request assistance on how I can concat the values on the smart capture going to the URL after submitting the form. Here is my ampscript on the cloud page: %%[ Var @EMAIL, @NAME, @...
0
votes
1answer
22 views

SF Data Entry to Journey Triggering Twice

I have a journey that uses SF Data Entry and is triggered by ampscript in another email send writing to a field on a custom object in CRM. It's simple, the entry criteria is that the CRM field text ...
1
vote
1answer
30 views

Create Dynamic Sender profile based on any filtered data extension with common logo field (sync)

My goal is to create a Dynamic Sender profile based on any filter data extension (from sync) that would have the same "logo" field to determine the from name and from email. With this being ...
0
votes
1answer
30 views

How We can update All Subscriber object while sending an email?

I am trying to update the status of the User from Unsubscriber to Active at the time of sending an email, is there any way we can do while sending an email? I tried the code on the Cloud page and it ...
1
vote
1answer
52 views

Dynamic Alias from Data Extension breaks URL

We have a dynamically generated multi-language email which will take the country and language combination of a subscriberkey and fetch the content from a data extension, everything is working fine, ...
0
votes
1answer
9 views

Rounding a number from a Data Extension that has multiple decimals

I have a personalization field that reads from our data extension to show how many purchases have been made from the previous month. The DE I get with over 28k people doesn't shorten the decimal ...
0
votes
1answer
54 views

Preheader isn't appearing in Inbox [duplicate]

I was trying to discover why preheaders of my new Marketing Cloud customer, isn't appears on email inbox. First I duplicated one of the emails they are used to send and inserted a preheader test ...
0
votes
1answer
32 views

How to Retrieve the table same as excel table into an email using ampscript?

How to output excel table as table into an email using amp script code? but each week the number of products I feature could change up or down, how could I build the email so that it can pull in each ...
0
votes
1answer
28 views

Ampscript to render First name not working. MC

Hi %%=IIF(Empty(first name),"their", first name)=%%, Hi Folks, I have tried to render this small script using AMPscript but seems like it's not working. I have added the code I tried above ...
0
votes
1answer
49 views

How do you work with the DateAdd function to add hours?

I'm new to AMPScript. I'm working with a Journey with SF Data Entry Source, specifically trying to send emails after someone registers for an event (which is logged in CRM). I want to add six hours to ...
4
votes
1answer
58 views

When using GTL in my mailings, I get a broken duplicate of the Mail after the real one

Nice to be here. I try to create an email on the basis of GTL. I open an AMPScript variable, which contains many key value pairs in a flat JSON format. I do this at the start of the mail like this: {{....
0
votes
1answer
31 views

Attaching personalized documents in Marketing Cloud

I have seen questions about document attachment in Marketing Cloud here, but we have a more complicated requirement. Our documents will have personalization, and they'll be different for all contacts, ...
-1
votes
1answer
12 views

Dynamic/Personalised link in Email Studio

I'm trying to send out a survey email using dynamic survey link to different people. What would be the ideal way to achieve this? Do I just upload it to DE and use AMPScript? Thanks
1
vote
0answers
41 views

Discount Coupon Codes with the opt-in functionality in Marketing Cloud [closed]

I am trying to send the discount coupon codes upon opting-in to my contacts with the below conditions: Initial Opt-in email - Opt-in to our emails and we’ll give you a discount code (click button to ...
0
votes
1answer
30 views

Encrypt the FormURL varaible on form Submission [closed]

I have create the contact us cloud page using the ampscript, created two cloud page one is the main page which pre-populate the form values and on form submission it will redirect to thank you page ...
0
votes
1answer
41 views

Ampscript Only reading first Integer

We recently set up an email that needed different content based off if a sales goal was hit. We had the following ampscript, but for some reason the system would only read the first integer. So if ...
0
votes
0answers
45 views

500 internal server error when using RetrieveSalesforceObjects when Contact is abscent in CRM?

I am having an issue working with RetrieveSalesforceObjects Method, I am having 500 interval error whenever I am having a wrong contact id, I tried to follow the recommended method, check %%[ Set @...
0
votes
0answers
50 views

ClaimRow in SSJS does not work

I have wrapped AMP script function ClaimRow in to the SSJS it works and changes the boolean field to true but when I do lookup rows this change is not visible.. I had issue in the past and that is why ...
1
vote
1answer
30 views

LookupOrderedRows pulling in incorrect data into emails / formatDate, formatNumber

I am using the LookupOrderedRows function in an email to pull in Apartment information such as Address, Number of Guests, Available Date, and Price. The issue is that in some instances, the function ...
0
votes
1answer
55 views

How to loop through a DE to find the closest birthday date in comparison to NOW()?

I want to loop through a DE that contains the attributes of a family, to retrieve the name and birthday of the family member who's birthday is the closest to NOW() AND is within the next 90 days. I ...
1
vote
0answers
67 views

CloudPage UTF-8 encoding issue - SSJS / AMP

While creating cloud pages I would like to debug the pages and don't want to wait every time somewhere between 5 and 15 minutes for the page to be re-published. That's the reason why we are using a ...
0
votes
1answer
63 views

Inactivating a Link in the email for FTAF

My client has a custom unsubscribe page using cloud pages (Using CloudPgeURL function) in all emails. When a subscriber receives the email and forwards it to a friend, the friend is able to click on ...
0
votes
1answer
41 views

CloudPage AMPscript for Smart Capture Form

I have a customer portal that generates a unique URL that contains the Subscriber Key of my record (mdmid). The customer would click on the URL and brought to a CloudPage. On the CloudPage would just ...
1
vote
0answers
51 views

How to get users roles in sfmc using cloud page

I have cloud page to retrieve user details from SFMC, I need one more field roles. Please help me how to get user roles. %%[ var @rr, @CategoryID, @email, @ActiveFlag, @CreatedDate, @UserID, ...
0
votes
0answers
18 views

How can I update regex to remove "HttpGetWrap|" from url?

Looks like there is a bug when using an interactive email form where httpgetwrap| isn't stripped out automatically. Until this is fixed I am pasting the code in an HTML template and trying to fix it ...
0
votes
2answers
40 views

Is it possible to use Ampscript to print a SET value inside a set value

I am using some AMPScript to SET specific subject lines based on certain date ranges I have SET the @Subject to include the @month value but the output is not displaying correctly %%[ Set @month = ...
0
votes
0answers
28 views

How can I make HTML forms with AMPscript Formhandlers run faster or add a loading graphic?

We use forms with form handlers instead of smart capture, but I find the process from form submit to formhandler to confirmation runs very slow. Is there a way to speed it up or at least add a loading ...
0
votes
1answer
24 views

Template-based email Litmus preview showing only a text list of content blocks

The email shows fine when I send a preview to my email clients, but when I preview it in the Salesforce Litmus tab, I just get a list of AMPScript content blocks that look like: %%=ContentBlockbyID(&...
0
votes
1answer
48 views

Ampscript for multi language: date format in code

I am a beginner in AMPscript and I am facing an issue. I would like to convert a date format into the customer language. For now, I was able to convert the format from "xx/xx/xxxx" into &...
0
votes
1answer
51 views

Passing attributes via SMS and capturing response to Data extension

I have an Outbound SMS message and a Text response message setup. These work as planned based on the Next Keyword 'INFO' When a customer replies with this keyword i want to save their information ...
1
vote
1answer
37 views

LogUnsubEvent with AMPscript Not Logging All Items?

Using the AMPscript below, these items are not being logged: JobID ListID BatchID Reason The AMPscript exists on a CloudPage. Tracking > EmailName > Overview tab > Inbox Activity > ...
0
votes
1answer
42 views

Is there a way to prevent product duplicate recommendations when using Einstein?

We're using an Einstein Recommendations logicID to pull in 3 products. Example: Cat Product | Fish Product | Dog Product But sometimes, the same product recommendation will appear twice. Example: Cat ...
0
votes
0answers
39 views

Uploading image via Cloud Page form - SFMC

I have a problem to posting an image in Content Builder. The problem is: a landing page is responsible for sending an image to the Content Builder. The sending is done through a fetch method, ...
0
votes
1answer
43 views

How to assign multiple unique coupons to the same email using claimRow()

i have a question right now i am using the claimRow() for sending the coupon codes to the customers(email) through journey builder. Now the problem is no matter how many times they have been added to ...
0
votes
1answer
33 views

Email is not Rendering Coupon Code

We have an email in prod that is for some reason not displaying some users their coupon code. In testing, I receive a code across multiple email clients. Email Ampscript is %%[ SET @Salesforce_Id = ...
0
votes
0answers
29 views

How to make number locale dynamic with AMPscript?

I am populating an email with localised number formats such as 1,000 for en-GB and 1.000 for de-DE. I want to make the locale part (en-GB) a variable so that it populates automatically based on the ...
1
vote
1answer
52 views

AMPscript for Dynamic Sender Profile

I'm trying to setup a dynamic sender profile by only changing the Sender Name based on my records sales rep. I have 2 basic data extensions I need to use, one being my sales rep table as a reference, ...
0
votes
0answers
57 views

HTML of this message exceeds the limit of some mail clients

I have created an email in which there are 2 content blocks. One block fetches the subscriber key(salesforce id) from the email and then creates a table on the email with its associated product name ,...
0
votes
1answer
25 views

Concat Dynamic Variables with static URLs

I have URLs that are dynamic based on the user I want e.g. https://website.com/user/username/settings . The data extension I want to set @username = username, then input it in the middle of the string ...
0
votes
0answers
25 views

Capture View In Browser in Salesforce Tracking

I am looking to capture the final post-send %%view_email_url%% url in my tracking. Is there a way to use AMPscript to capture this value for all sent email campaigns? Looking to be able to pass the ...
0
votes
0answers
39 views

Dynamic HTML title tag

I want to create a dynamic HTML title (INPUT). I now do this using the contentblockbyID function: <title>%%=ContentBlockbyId("123456")=%%</title> In the content block I have ...
0
votes
1answer
42 views

"Invalid URL" message on webpage while accessing marketing Cloudpage on live site

We are receiving "Invalid URL" message on webpage while accessing one of the Salesforce Marketing-Cloud Cloudpage on a live website , Below are some details from our environment The ...
0
votes
1answer
26 views

RSS feed via Ampscript (with earlier sample code failing)

I am trying to create a content block in email-studio, using xml/rss feed to import content for display. I've used both (1) creating a standalone content block, and (2) inserting a code snippet ...

1
2 3 4 5
56