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
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
173 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
vote
1answer
98 views

AMPScript Lookup and LookupRows being stored

Is there a way to prevent Salesforce Marketing Cloud from storing previous Lookup values, or to allow subsequent Lookup functions to overwrite previous values? Problem: I recently built a Cloud Page ...
0
votes
1answer
60 views

Is there a character limit on From Names in sender Profiles using AMPScript?

I have been using some AMPScript that Lookups a column in a DE to set what the FROM Name should be in my sender profile, this has been used for well over a year without any problems. Recently we've ...
3
votes
1answer
94 views

One-Click Unsubscribe Not Working

I created a one-click unsubscribe. But it is not unsubscribing any user.The user is still active in all subscriber list. I've used the below code %%[ /* declare variables */ var @sid, @jid, @listid, @...
1
vote
1answer
72 views

Does AMPScript code count towards character length in Mobile Studio SMS?

I have an SMS message which contains AMPScript which pushes the messages length past 160 character length. MC warns me that this will use more than one message (and will be billed as such). Is this ...
0
votes
1answer
50 views

AMPScript Help if error

I just try to write a dynamic text field, I need to took data from a Data extention field called Toplam and I have 3 rules if the customer point is greater than 35 points I show them Option 1, if the ...
0
votes
1answer
71 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 ...
1
vote
0answers
30 views

Storing a Full Name in a custom Data Extension from an Info Capture response

We are trying to store a full name response from an Info Capture message into a custom data extension via AMPScript. We decided to use this approach instead of adding a new attribute to the ...
0
votes
2answers
80 views

Add new campaign member to existing campaign using ampscript

I'm trying to add new campaign member in SF using ampscript in a landing page I built. Something is wrong with code as it's isn't working and Error 500 is displayed. Please see code attached below: ...
0
votes
2answers
95 views

Format AM/PM DateTime to 24 hour time

I have a data 9/14/2019 4:37:57 PM I want to format this to: 20190914T163757 How do I format it so that if it includesPM to 24hour using ampscript?
0
votes
1answer
61 views

Formatting Dates and Time for SMS using AMPScript in Content Builder

Having a format issue on a SMS in Content Builder. Can someone point me to the correct code for this? Also would love some advice to learn basic AMPScript coding. Books? Tutorials? Online classes? ...
0
votes
1answer
71 views

Pass line break to Long Text Field from Journey Builder

I have a Journey in Marketing Cloud that is creating records in an object in the Sales & Service Cloud from data stored in an SFMC Data Extension. That object has a long text field that I ...
0
votes
0answers
33 views

SMS reponse is not working properly

When test a SMS response without any AMPscript, it is working fine. But when I place the below AMPscript, it is neither showing error response nor showing positive response. Below is the AMPscript: ...
0
votes
1answer
61 views

Image disappear when the email is sent

I have this code that includes the picture of a product. <!--[if mso | IE]><td style=vertical-align:middle;width:150px><![endif]--> <div class="mj-column-per-25 outlook-group-fix"...
0
votes
1answer
78 views

How to use parameter from URL in Lookup

We want to create a Cloud Page that dynamically changes content in the page according to a URL parameter. Users will visit the page directly, we won't send them to the page from email. What I did: ...
1
vote
1answer
106 views

Can i set variable value into Smart Capture submit option url

I have an cloud page which include smart capture form, which having a checkbox, email, country and address fields. I am setting variable value to true and false using jQuery if checkbox is true or ...
0
votes
1answer
44 views

RSS Feed via AmpScript

I am trying to pull posts from my RSS feed into an email via Ampscript. I have the code correct and it's pulling the right number of stories. I just want to change the number of stories the script ...
2
votes
1answer
144 views

Using AMPScript Pre-Fill a Form in Salesforce Marketing Cloud

I am having custom form instead of smart capture from on my cloud page. This form having multiple check boxes. Now i want to show this form pre-filled if existing user visited to this page. Users ...
0
votes
1answer
67 views

How to escape HTML or AMPscript in AMPscript variables?

I was wondering what happens when a customer is putting html or scripts in his profile attributes on Commerce Cloud and he orders something and we send out an order confirmation email with those ...
0
votes
0answers
64 views

Issue in retrieving response body for 4xx and 5xx response code via HTTPPOST2

I am calling third party API via HTTPPOST2 using ampscript, and need response body for response codes like 4xx or 5xx. For success scenario, I am getting the response body in response parameter of ...
0
votes
1answer
95 views

How to use Ampscript to correctly display date to match correct country date/time or update SQL to save data in correct time zone

We are pulling data into a Marketing CLoud Data Extension from Salesforce CRM using a SQL Query (from a Salesforce Campaign). The issue we have is the date data that is pulled through is US date/time ...
1
vote
2answers
87 views

IF Statement Ampscript ignores 6th IF statement

I have an email that is in build with a large amount of IF statements contained within the email. The concept of the email is that if the 10 item fields are populated then show all 10 within the body ...
0
votes
2answers
94 views

AMPScript RetrieveSalesforceObjects with apostrophe returns error

I have a very basic retrieval of a Salesforce record based on email address in AMPScript that works 99.9% of the time SET @retrieveContact = RetrieveSalesforceObjects('Contact', 'Id,Email', 'Email', '...
5
votes
1answer
76 views

How to handle umlaute/mutations in AMP Script with REST API?

we are using AMPscript to transfer/send parts of our mailings we send through Email Studio (not Salesforce) to our REST service via HTTPPost to make the information available in an external CRM that ...
1
vote
1answer
135 views

Ampscript / syntax for empty field?

I created an ampscript on a Landing page that should update Salesforce boolean fields and also suppress the current value of a specific text field (so that we get an empty value). The URL of the ...
0
votes
1answer
67 views

Track Email Code snippet included in email, yet no opens are being recorded

I'm using the data view to query opens for the last 30 days. It's been working for the past 2 months. My devs just re-wrote our HTML based email with it's ampscript but the code is still there. I ...
0
votes
2answers
54 views

Einstein AMPscript string comparison not working

In our localized product recommendation display we want the button text to have the language in which the recommendation is rendered. I've written some Einstein AMPscript to capture the countrycode of ...
0
votes
0answers
21 views

How to updated the content (Add records one by one) in content block using SSJS with AMPScript in Marketing cloud?

I have done add functionality to store content in content block using ssjs. But i need updated functionality, Means whenever we give the user require info in the web form, then submit. So the content ...
0
votes
1answer
122 views

Error on data extension InsertData AMPScript function

Could someone explain below error? InsertData Function is not valid in content. This function is only allowed in a non batch context I am trying to insert some data into logging Data Extension at ...
0
votes
1answer
56 views

Need help with AMPscript code

can someone help me to write a code that will retrieve a salesforce object. The name of the field in SF is: Preferred Contact Time The name of the field in MC synced is: ...
1
vote
1answer
37 views

AMPscript: Including Ordinal Indicators In Date Formatting

I have an automated email that will be sent every month and I'm trying to get the expiry to reference the last date of the current month formatted to read 31st January, 2019 or 28th February, 2019. I'...
0
votes
2answers
54 views

Conditional not evaluating values

Why is the Set @subject = "The road is yours"executed but the if-else conditions are not? %%[ var @subject set @subject = "The road is yours" IF City Name == "Hongkong" AND Locale Value == "hk" ...
-4
votes
1answer
54 views

How to create a Sendlog functionality using in AMPScript [closed]

Whenever an email is sent to target audience , client wants to know which email has been sent to customers and at what time its sent. Kindly provide a solution for it.
0
votes
1answer
60 views

RowCount LookupRows Function - Max 2000 Rows

I am using the following AMPscript: SET @c10 = RowCount(LookupRows(@De1,@band,@value10))to retrieve and set the count of the number of rows in a DE. I have now run into an issue where I need to count ...
1
vote
1answer
88 views

AmpScript and JavaScript w/Cloud Pages

My objective is to insert the subscriberkey into a data extension on JavaScript onclick event. I do not see any viable documentation that works. I've tried passing AmpScript variables to Javascript ...
-1
votes
1answer
57 views

Can i get specific value from string using ampscript

I am having a string and I want to get a specific value from it. @string = "[ewqewe]wwerc:[value1]&31545415151|erertrtc:[value2]&nbmnbmn|uiuoiuoioioc:[value3]s:[value4]pupup[vfdvdfv]...
-2
votes
1answer
33 views

How to store the content in content block using AMPScript in salesforce marketing cloud? [closed]

How to store the content(FN,LN,Email) in content block using AMPScript through landing pages?
-2
votes
1answer
169 views

AMPScript to create Campaign Member

Using AMPscript, I need to check if the form submission is an existing SF Campaign Member. If not, I need to create a new SF campaign member record using AMPscript. %%[ var @id, @row, @campaignId, @...
1
vote
0answers
25 views

Conditional appearance of a comment box - based on answer to question in a survey [closed]

I have a ten question survey. Each question has the same radio button choice for answers: Strongly Disagree Disagree Neutral Agree Strongly Agree N/A We only want a comment box to appear if someone ...
0
votes
0answers
58 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
2answers
163 views

Ampscript error: Invalid index (parameter 2) passed to Row function. Index must be less than or equal to the row count

Please Help, i'm new to AMPSCript here is the error that i get: Error Message: ExactTarget.OMM.FunctionExecutionException: Invalid index (parameter 2) passed to Row function. Index must be less ...
2
votes
0answers
162 views

Parsing a date string in dd-MM-YYYY format with AMPscript

What's the best/simplest way to parse a date string in dd-MM-YYYY format with AMPscript? %%[ var @dateString1 var @date1 set @dateString1 = "21-08-2019" set @date1 = DateParse(@dateString1) ]%% ...
0
votes
1answer
25 views

Automated email sending

I have a landing page in salesforce which has its own form and using ampscript i am storing data in dataextension .Now the data that is being send contains two email address and i want to send an ...
0
votes
1answer
51 views

DateAdd with a format date in a variable

I was trying to concat a date in a URL with a specific format, but I need to add 1 day to the date that already exist in data extension. VAR @sd, @formatSd, @date_plus1 set @sd = AttributeValue("...
2
votes
0answers
56 views

Getting the name of content block

We can easily get the name of Impression Region using the %%_ImpressionRegionName%% Personalisation String. This works fine for Impression Regions defined with Ampscript or with Dynamic Content. ...
1
vote
0answers
36 views

AMPscript Dynamic Date MobilePush Message

Is it possible to reference a date attribute of a particular push message? As in something like: %%[ VAR @messageCreatedTime SET @messageCreatedTime = MessageCreatedTime ]%% Inbox Subject Line: %%=...
0
votes
1answer
42 views

Get email id from a previous send using ampscript

I am trying to be able to forward an email using Ampscript. I am able to retrieve the JobID for the previous send. I don't know if one can access a dataview using Ampscript for this. I was wondering ...
0
votes
1answer
57 views

adding extra inline css attributes with ContentImageByID

I have the following code which works fine, however the image loads at its original width at 540px. I would like to change the width of the image. I've tried adding style to <td> but it doesn't ...

1 3 4 5 6 7 44