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

Linking email button to a column in the DE

i have a Covid email message we are sending to our business customers which will have a button that they can click which will take them to a landing page. I have created this landing page in Cloud ...
0
votes
0answers
20 views

Passing value to AMPscript varible from SSJS is adding hidden chars

From some reason, using the following SSJS code: Platform.Variable.SetValue("@sid", missed[0]["SubscriberKey"]); Adds some hidden characters to the end of the string. %E2%80%8E is added, which is ...
0
votes
1answer
15 views

AMPscript - Referencing a Shared Data Extension

I'm using Lookuprows to retrieve data from a Data Extension. When used in an email, it's not erroring, but it's not pulling in any data either. The top part of the AMPscript looks like this: %%[ ...
0
votes
1answer
15 views

AMPScript for Dynamic Sender Profile not firing

I’m trying to write a short Lookup script for a Dynamic Sender Profile and I’m struggling with it. I have an email that I want to send to the members of a Data Extension, and I want the email come ...
0
votes
1answer
29 views

Making IFs ELSEIFs & ANDs work

I have the below AMPscript that is throwing this error: Multiple logical conditions for a script IF/ELSEIF exist but the required logical AND or OR operator joining a secondary condition is missing....
1
vote
1answer
123 views

AMPscript, how to learn?

I'm a designer and I need to learn AMPscript. I wonder if you know any courses. And also do you need to be a developer or know programming languages ​​to learn AMPscript?
0
votes
1answer
24 views

Data Extension field has Colon

I am attempting to use an exclusion script on my emails in Journey Builder. We are loading a data extension with opportunities that we would want to exclude from the send. Our exclusion looks like ...
0
votes
1answer
26 views

Access UTM parameters inside AmpScript

I want to access the addition parameter[utm_campaign] inside an email to supply it to a connected app using an HTML attribute. How can I fetch the attribute?
0
votes
1answer
26 views

dynamic from name for SMS

Is it possible to change the from name (sender ID) for MobileConnect with ampscript? Based on telecom regulations we need to send SMSes with different from names based on which country we're sending ...
0
votes
1answer
27 views

use ampscript for URL image on EMAIL TEMPLATE

I use an email template, and I put an image with a URL on email. The link contains a query string, something like: https://google.com/?privateId=X I want to make X to dynamic for each user AND ...
0
votes
1answer
25 views

AMPScript Link Tracking - Does RedirectTo has to be Inline? Understanding

The Question(s): Does RedirectTo has to be Inline to work properly? Can RedirectTo be somehow used in AMP-Script Blocks to work as a variable? My experiment ;D Works Inside a ContentBlock in the e-...
0
votes
1answer
53 views

Help with inline IIF ampscript statement

I am trying to write an inline IFF statement for use in our Web Analytics Connector parameter string. Currently I have the following: ...&utm_content=%%=iif(IndexOf("%%linkname%%","http")>0,"...
1
vote
3answers
54 views

Is this valid AMPscript?

Is the "AND FALSE" portion proper AMPscript syntax? I came across this kind of statement but am not sure what to think of it. %%[ IF @TableName == "Cornelius" AND FALSE THEN SET @data = "12345" ENDIF ...
1
vote
0answers
37 views

Random Space Insertion When Using Replace() Function in Content Builder

We service multiple regions with regional copy and links in our emails. Because of this, we often rely on the use of data extensions with region IDs as a unique identifier and "tags" in the copy that ...
0
votes
1answer
22 views

Exclude all send from one particular email of journey

I came across a need of exclusion script which can exclude all the email send from one particular email of a journey. if I just add "1" in the exclusion script does it exclude all the email send from ...
0
votes
2answers
47 views

What is the difference between 'Lookup' Function and 'LookupOrderedRows' function in AMPscript? Which has faster performance?

I'm studying for Marketing Cloud consultant exam. One of the questions relates to performance of the two functions Lookup Function and LookupOrderedRows function, specifically which is faster? I ...
0
votes
1answer
29 views

ClaimRow function for dynamic coupon

I've been having a look at the ClaimRow function to build a dynamic coupon code email and wondered if anyone can help me with a few things... It's advised to add an IsClaimed field to your DE for ...
0
votes
0answers
21 views

UpdateSingleSalesforceObject function not managing properly exceptions handling situations

I am in the process of doing my unit tests for my implementation. I am using in a landing page the UpdateSingleSalesforceObject() function. When I try to update a record in SalesCloud and I get a ...
1
vote
1answer
40 views

How to fetch the values from two DE's and insert into another DE

I'm trying to track the landing pages opens/clicks data into a Data Extension. I'm fetching the CHILD BU details and LANDING PAGE details through two DE's (here I'm storing and fetching the data )and ...
1
vote
1answer
39 views

How do i use multiple AMPScript functions for a single variable?

I have a variable that that is pulling from another variable and applying the Field function to it as below. set @CampaignStartTime = Field(@CampTypeRows,"Event_Time_Text__c") I now want to apply ...
0
votes
3answers
98 views

Fetching the landing page details

I'm fetching Job ID, Subscriber key of a subscriber into a Data Extension who clicks the landing page. Code in the Email %%[ SET @Sub = _subscriberkey SET @CloudPageID = 1234]%% Code in landing ...
0
votes
1answer
48 views

Uploading image via Cloud Page form and then retrieving Content Builder image URL

I have created a Cloud Page with a form to upload an image using this tutorial: https://sfmarketing.cloud/2020/02/29/create-a-cloudpages-form-with-an-image-file-upload-option/. I am able to ...
0
votes
3answers
47 views

Remove HTML element with AMPscript?

Can AMPscript be used to find HTML within the body and delete/replace it? Trying to do this in Salesforce Content Builder. For instance, find <span style="color:red;"></span> and delete/...
0
votes
1answer
59 views

Why can't I make multiple LookupRows in Salesforce Marketing Cloud?

On a CloudPage, I want to accomplish 3 loops. In each loop, I want to retrieve the total number of records from a Data Extension and insert a new record. Here is the code I came up with. %%[ SET @...
1
vote
1answer
36 views

Smart Capture Form - insert record into Salesforce

I have a Cloud Page with a Smart Capture form. The Smart capture form works as intended and stores the information into a specific Data Extension. In addition to that, I would like to capture the ...
0
votes
1answer
33 views

_dataSourceName for SMS activity in journey builder?

I'm trying to create a SMS activity in Journey Builder and use the entry source (data extension) name in the ampscript. Is this even possible? This is the ampscript %%[ set @dataSourceName = ...
1
vote
1answer
28 views

Only show AttributeValues when they are not empty

I have a client who has up to 42 profile attributes that he wants to display in an email. Some subscribers might have all 42, some might just have 2. I'm trying to use BuildRowsetFromString and a for ...
0
votes
1answer
20 views

encode in md5 a field of a form in cloudpage

I have a form on cloudpages, my question is if it is possible to be able to encode one of the fields in md5, to send it to the DE as subscriberkey. I have tried javascript but I have problems because ...
0
votes
1answer
21 views

Create a form in cloudpage [closed]

I am trying to make a form on a cloudpage, I have created the DE where I want to send my data. I would like to receive the email and the user's name on the form. How can I make the email through a ...
0
votes
0answers
37 views

Lookup() function not working with Send Log DE

I am trying to retrieve the 'view as web page' link that is stored under the Send Log Data extension, but I had no luck. When I send an email to myself, the following attributes are showing correct ...
0
votes
3answers
66 views

How to Fetch Child BU Name

Currently, I'm fetching Job ID, Subscriber key of a subscriber who clicks on the landing page. Code in the Email, %%[ SET @Sub = _subscriberkey SET @CloudPageID = 1646]%% Code in the landing page ...
1
vote
1answer
36 views

Retrieve/Update Custom Object using AMPScript

I am attempting to update a custom object on Sales Cloud through a Marketing Cloud landing page. I am not using MC send, the email comes from Sales Cloud and lands on an MC page, then the form queries ...
0
votes
1answer
27 views

Journey Data connected to other Data Extension

We are using an API Entry Event that populates information into a Data extension called Purchase to trigger a first purchase journey. The Purchase DE contains just the basic purchase information and ...
1
vote
1answer
23 views

Using AMPScript for a dynamic URL

This is my first post but I thought I would ask the community for feedback. Some background: I am creating an email for a client that would then take over uploading data extensions and sending the ...
1
vote
0answers
25 views

Impersonate a Subscriber on a Cloud Page

When a Subscriber clicks on a CloudPagesURL() link in an email, they are sent to the cloud page with a QueryString (qs) parameter. This tokenized value tells the Cloud Page who the subscriber is, and ...
0
votes
0answers
28 views

Email address shows as empty with claimrow function

Puzzled about Claimrow function. We are assigning unique codes to unique email addresses in a daily automation. We have one data extension that we send to, and another data extension that keeps the ...
0
votes
1answer
34 views

How to try catch RetrieveSalesforceObjects in AMPScript

I use the RetrieveSalesforceObjects function within an Email that I send out in a Journey, recently some people have been failing in the email send. Which I suspect is because of this line, I have ...
1
vote
0answers
39 views

GET Response containing png image in Marketing Cloud

We are using this api (get method): https://rapidapi.com/qrcode-monkey/api/custom-qr-code-with-logo In order to create QR images on the fly when sending emails to our customers from Marketing Cloud. ...
0
votes
1answer
28 views

Using API Event in Journey Builder with Custom CloudPage Form

We designed a cloudpage with a simple form (bootstrap CSS utilized) that has 2 'textarea' types of fields (so, basically, free comment areas). Since this survey will be sent to our subscribers ...
0
votes
1answer
39 views

Why isn't my dynamic Ampscript rendering correctly?

I have the following lines on a CloudPage %%[ SET @dynamicCode = CONCAT("Some code goes here") TreatAsContent(CONCAT("%%[OUTPUTLINE(CONCAT('something gets printed<br>'))]%%")) /*...
0
votes
0answers
19 views

Personalised Cloudpage URL AMPSCRIPT

I have 4 fields (MobileTel) (CIF) (PURL) (RepIAC) in my DE. i want to send an sms containing a cloudpage url that is personalised and contains either: (CIF) (Agent PURL) (AgentIAC). On Cloudpage ...
1
vote
0answers
43 views

Have to Track the Campaign ID and Description using DataViews

Currently, I'm tracking the email sent details using data views and storing in a DE, I need to track campaign ID and Description in the same DE. Is there a way to track it using Data Views? In my ...
0
votes
1answer
18 views

Unsubscribing a subscriber using SSJS from a publication list based on cloudpages URL

This is what I have so far from the help documentation and it doesn't seem to work %%[ VAR @subKey SET @subKey = [Email Address] ]%% <script runat="server"> Platform.Load("Core","1"); var ...
0
votes
1answer
37 views

How to add two values from a single field with AMPscript

XML field DISCAMT is added multiple times using varying values and I'm interested to total these and show in one line. What function can be used here or just create new field/s per each product ...
0
votes
1answer
24 views

Ampscript block if not empty not collapsing

In my code I have 3 block sections. Each with replies. The way it works the data extension gets checked to see if there's content. If no content then nothing displays. But the block isn't collapsing. ...
0
votes
1answer
44 views

IF-statements producing errors in isolated cases

I'm using the following AMPscript to set variables and to allow fallback values if data isn't available for a Guardian. %%[ SET @rows = LookupRows("Contact_Salesforce","Id", _subscriberkey) SET @...
0
votes
1answer
44 views

Randomly select 5 rows from a synchronized Data Extension

I am wondering if it’s possible to randomly select 100 rows from a Synchronized Data Extension over 500 thousands records, without adding extra columns to it and using ampscript to do so at send time? ...
0
votes
1answer
34 views

Dynamic content within an attachment [closed]

Can we have dynamic content built within an attachment. E.g. i have a disclosure statement that needs to be attached with an email. This statement however will contain the customers name and address. ...
0
votes
2answers
34 views

ampscript first name personalization using a data extension

We are using a data extension to populate a subject line with the first name and it looks like this: %%[ VAR @FIRST_NAME SET @FIRST_NAME = [FIRST_NAME] /*SET @FIRST_NAME = "test"*/ if length(@...
0
votes
1answer
34 views

AMPscript lookup not returning value

fairly easy question here I guess but I'm having problems with it. So I was trying an AMPscript exercise in trailhead: Also, can be found here as exercise 3: https://trailhead.salesforce.com/...

1
2 3 4 5
45