Skip to main content

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
2 answers
3k views

Can a preheader show preheader text only?

When I add this preheader in Marketing Cloud: Only a click away and test send my mail to my mailbox, my preheader will look like this: Only a click away Online Version Design Catalogue Find a store ...
0 votes
1 answer
1k views

Exclusion script not working for Journey builder send emails

I am trying to use an exclusion script to exclude the contacts from the DataExtension marked as root. Refer to the screenshot of the data and DE structure. The two fields I am referring to in the ...
1 vote
1 answer
981 views

Ampscript GET view_email_url

Hello I have a problem with an ampscript code I can not get the online version and send it in salesforce cf the following code: %%[ var @contactId, @campaignId, @id, @contactRows, @limitRow, @nom, @...
1 vote
4 answers
1k views

Submitting HTML characters to a Data Extension via Landing Page and SSJS

I have tried to push data to data extension through a landing page using SSJS. The form fields contain HTML characters (which will import to the Data Extension fine). I'm getting this error when I ...
4 votes
3 answers
5k views

Variables in alias tag showing in link level reporting

I'm trying to include a couple of variables within a Concat inside an Alias tag and I am not seeing the expected string in "LinkName" reporting values but rather the variable names. So I get ...
0 votes
1 answer
1k views

Send data from one CloudPage to Another

I have a cloudpage that register some customer infos(Fname, Lname, Id...), and theses info needs to be transferred to another CloudPage in order to display the correct Content for that Customer, I'm ...
0 votes
1 answer
1k views

An unrecognized expression appears in a script block. Script Expression: [field_name]

When previewing my email I get the following error message: An unrecognized expression appears in a script block. Script Expression: < MemberID: XXX JobID: 0 The error appears to be related to ...
1 vote
1 answer
906 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
1 answer
45 views

Required Field Missing Error on Landing Page

I'm encountering the following error when I'm trying to publish landing page: Error Message: "Call to create the salesforceobject Account failed! Error status code: REQUIRED_FIELD_MISSING Error ...
2 votes
1 answer
1k views

Custom CloudPage Preference Center

I'm trying to build a simple preference center using Smart Capture. I'm trying to have the user experience be when the person clicks the "Unsubscribe" CTA in the footer it sends them to a Landing Page ...
0 votes
1 answer
38 views

ampscript lookup does not work when field length of the lookup field is not set

This is my amp script code : %%[ Var @email Set @email = Lookup("forgot_password", "email","locale","en-US") ]%% %%=v(@email)=%% The locale field length ...
1 vote
1 answer
830 views

RequestParameter and view_email_url

Is it possible to send extra parameters to view_email_url and then pick them up and use them on the web version of the email? I would like to do this so I can perform different actions, such as ...
0 votes
1 answer
41 views

How to end BuildRowSetFromString in a period

In my DE, I have a list of last 4 of account numbers in one field. The list is delimited by a pipe and will be different for each record in the DE (could be 2 account numbers, could be 100 account ...
3 votes
2 answers
70 views

AMPscript Current Sunday

I'm attempting to build a call by date and have that date be the Saturday of the given week. These emails are sent Monday - Friday, I'm struggling to lock down the AMPscript for it. Here is what I ...
1 vote
2 answers
54 views

Use ampscript to check data extension has an EmailAddress field

I've got a custom process which allows users to match manually uploaded data to SF ContactID values. It relies on the EmailAddress field being called EmailAddress and having the correct field type to ...
0 votes
1 answer
1k 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
1 answer
437 views

Ampscript Personalization String for Subscriber CreatedDate in Email

I am trying to check the created date for a subscriber upon sending an email to them. I then want to use that value to do something different in the email if the Created Date is today to basically ...
1 vote
1 answer
1k views

AMPscript: Pull data extension row count

I'm trying to use AMPscript to pull the number of rows (all rows, rather than matching to a specific variable) in a data extension and insert that variable into an email. However, the variable I'm ...
0 votes
0 answers
30 views

update preferences from a community page to salesforce marketing clouds data extension

I would like to know if I could update the preferences of a subscriber from the community clouds page to SFMC's Data Extension.
1 vote
1 answer
1k views

Marketing Cloud: AMPscript redirect not working

When trying to use 'redirect', my 'starting' page will no longer load (returning the 500 error). Not sure what I'm doing wrong here. FYI: If I remove the redirect code, the page loads just fine. ...
1 vote
1 answer
1k views

Web Analytics Connector customization

I have to setup my WAC configuration including a IIF() function to detect if linkname contains the "%" char. In case of yes, I will include one AMPSCript var I am setting up in the context called "@...
0 votes
1 answer
70 views

How to update data on data extension using AMPscript?

I need help with updating existing data in a data extension. When a user clicks on an email link to change their status, I need it to be changed in the data extension. For example, if user A has ...
0 votes
1 answer
61 views

Pre Header in Salesforce

Ive created a data extension with several attributes , one of them being pre header. This is where my content lies. When I add ampscript in my email it pulls the pre header however when I do the real ...
0 votes
1 answer
25 views

How to find the Page ID of the same page where the AMP script is written

Print Page ID on Landing page using AMPscript I am in the process of creating a page to store information from customers who come to the landing page. I want to write it as follows, and I have had no ...
0 votes
1 answer
2k 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 ...
0 votes
2 answers
1k views

AMPscript Lookup fails to find record

Having trouble with lookup not returning what's expected. The @LOTeamName is what I'm having trouble returning. No errors when I run it, it just doesn't return anything even though I know it's there....
1 vote
1 answer
1k views

Get Marketing Cloud UserID (numeric)

I'm currently following this guide: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-programmatic-content.meta/mc-programmatic-content/createDataExtension.htm To create a data ...
1 vote
1 answer
972 views

AMPscript: Rounding a number in a text field that has several decimals

I have a text field that holds price values like 1190.00 and 1216.666666667. I've used AMPscript to round the numbers to 0 decimal places. Referencing this Q&A Round a number with AMPscript I'm ...
0 votes
1 answer
923 views

Display Error Message - AMP Script

I would like to display an error message in login page, if the credentials are wrong or invalid. error message like "Invalid Username / Password" should be displayed next to the login button how ...
1 vote
1 answer
857 views

AMPScript: How can use DecryptSymmetric() function to decrypt an encrypted string from PHP

I need to decrypt an encrypted string using AMPScript's DecryptSymmetric() function which is coming from an external system(PHP). I am not sure which algorithm PHP should use to encrypt the string, ...
1 vote
2 answers
1k views

Update Data Extension with keyword in Mobile Connect Text response

I was trying to trigger a specific MobileConnect text response keyword which should update a Data extension. When I add some ampscript to the outbound response, I get an error saying "There was an ...
0 votes
1 answer
43 views

How to show place holder when value is ampscript?

When I want to see TT.MM.JJJJ as a default but because ampscript is used it shows dd/mm/yyyy I have added placeholder and timezone as well but it is not working. Could you please advise on that? set @...
0 votes
1 answer
43 views

Update the DE using Ampscript from Cloudpage

I've developed a landing page with two submit buttons, CTA1 and CTA2. When a user clicks on CTA1, data should be updated/inserted into DE1. Similarly, clicking on CTA2 should update/insert data into ...
1 vote
1 answer
1k views

Retrieving images from RSS feed ExactTarget with AMPScript

I am embedding an RSS feed in an email using AMPScript. I am successfully pulling in the title, description and link, but I’d also like to include the image that’s part of the description in the feed. ...
2 votes
1 answer
1k views

Creating new subscriber on ENT 2.0 account using ampscript

We are builing landing pages using ampscript to unsubscribe email address submitted via these pages. The pages should check for email address to existing subscriber and unsubscirbe them or create new ...
4 votes
3 answers
3k views

Server-side JavaScript and JSON

I would like to extract the data from a Data Extension column and parse it as JSON and use the data as attributes in an email. How would I go about doing this? Is there a combination of AMPScript ...
0 votes
2 answers
874 views

RetrieveSalesforceObjects with date filter - Ampscript

I need to consult Salesforce records that where created in the last 7 days, but when I test the email it appears the following error: Call to retrieve records for salesforceobject Questionario__c ...
1 vote
1 answer
307 views

Email triggered send job stopped by AMPscript Decode function issue

I'm struggling a lot and not even support is being able to help me with this, hope that you can, and read any idea. I got an email with 8 different SKUs populating each one from two DEs. The code didn'...
0 votes
1 answer
139 views

Lookup based on result from another lookup

I have a table that returns MID based on a concat of id and csid that are in my list. This works as it should. Can I use the mid to do a lookup on another data extension to return an address? If so, ...
2 votes
1 answer
545 views

Links with AmpScript Not Being Recognized in Journey Builder's Engagement Split Feature

I have a link in an email that has AmpScript in the url (https://somelink.com/group=%%SegmentName%%) and another link without ampscript (https://anotherlink.com/) The link without ampscript is ...
1 vote
1 answer
564 views

Send emails in Marketing Cloud without an email address in data extension

Im creating a transactional journey that is passing along an ID, which is related to a contact (field on Contact object in Salesforce) and which im pulling into Marketing Cloud. Im currently using ...
0 votes
1 answer
100 views

Limiting Submission of a Certain Field on a CloudPage

I have a CloudPage being used to collect appointments for a meeting time. I have one CloudPage, and five time slots mapping back to data extension, specifically to the field "Time." "...
0 votes
1 answer
214 views

CC'ing using AmpScript

Im trying to use AMPSCRIPT in the CC portion of the Journey. Since understanding Ampscript reads top down, and I can't declare the CC field in the body of the content, I have tried using these two ...
0 votes
1 answer
82 views

Sending AMPScript Variables to a Landing Page from Mobile Push

We're trying to send some variables to our landing page that are set within AMPScript through a Mobile Push. Within the setup of that Mobile Push (in the Alert Message), we have something along the ...
0 votes
1 answer
135 views

IF Statement not closed error

I'm getting an error with an IF statement, even though it was working previously. This is my code: Hello %%[IF Empty(@firstname) THEN]%%homeowner, %%[ELSE]%% %%=ProperCase(@firstname)=%%,%% [ENDIF]%% ...
0 votes
2 answers
152 views

How do I insert a data extension variable immediately after an "="?

So within my email, I can call a data extension field: %%User_Type%% When previewed, this displays as either "Free" or "Premium" depending on the user. For data tracking via google ...
0 votes
1 answer
140 views

AMPscript Wildcards?

I have 365 days of images. some are gif's and others are pngs. Format is daymarker.png or daymarker.gif. They are random on the days and they don't follow any pattern. Is there a way I can say IF ...
1 vote
1 answer
62 views

Only showing those that Return true from a FOR AmpScript

I am searching a data extension based on an ID and returning vairables and a link from those. I was able to get it to pull all the required data and show correctly. However when I try to add a ...
0 votes
1 answer
154 views

Ampscript code to cut part from string

I created a code to take the utm and cut it specifically in the campaign part of the utm and return only it. this code works as long as the utm campaign comes first. But I also need to consider that ...
0 votes
1 answer
47 views

Lookup function in email builder returning error "invalid field" and does not pull data

I am trying to pull first name of a contact to my email (emailbuilder) through a simple lookup on my shared data extension. <div style="display:none"> %%[ var @dataExtension, @...

1
2 3 4 5
66