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
0 answers
17 views

Using MC Data Extension to update HTML on Landing Page

Is it possible to pass HTML code through a Data Extension value to set the HTML for an AmpScript Landing Page?
  • 1
0 votes
1 answer
30 views

Ampscript personalization not working in block

I am setting up an email for refund confirmations. I have this ampscript set up: %%[ var @payment_method, @paymentblock, set @payment_method = payment_method ]%% Later on I have: IF @payment_method ...
  • 1
0 votes
0 answers
13 views

Using AMPScript to update all subscribers

I'm trying to use AMPscript to let people either unsubscribe or resubscribe themselves. However, I have a 500 error message. set @unsubscribeValue=RequestParameter('unsubValue') if (@...
0 votes
1 answer
47 views

Loop over RetrieveSalesforceObject to find a record not opted out

It's my first time posting here so forgive me if it's not following the community's standards. I'm looping over the Contact Salesforce Object, that in case more than one record with the same email ...
0 votes
1 answer
25 views

Can I add a list of same content block and update each content block's item based on a HTTP request?

I want to send email to my customers in SFMC. The email contains a list of products. The data of products comes from a HTTP request, and the HTTP response is a JSON object. Now I've developed a ...
  • 103
0 votes
1 answer
37 views

CloudPage parameter in a SMS [duplicate]

how to link a cloud page from SMS and passing a parameter to it? I tried with CloudPagesURL but I am not sure if it can be used in a SMS. when I enter this code to pass the parameter in the shorten ...
0 votes
1 answer
43 views

ClaimRow Function Does Not Work as expected with Data Extension Entry in Journey Builder

I have an issue with the ClaimRow() function added to an email part of a journey running from a Data Extension entry with 150 contacts. Each contact supposed to receive a unique URL pulled from DE ...
0 votes
0 answers
38 views

VAWP not working from VAWP log Data Extension

I'm logging variables for a send if _MessageContext == "SEND" using upsert to a VAWP Data Extension: IF _MessageContext == "SEND" THEN upsertDE("VAWP_Log", 2, "JobID&...
0 votes
0 answers
37 views

Changing text on an image

Hello I recently found in adobe there there is the capability to change text on an actual image through dynamic content - I was wondering if MC has this capability? See my screenshot to know what I ...
  • 125
3 votes
2 answers
93 views

Interpreting the code in emails SFMC

I am struggling with the problem of displaying a personalized field (first name) in email. The problem is that sometimes can happened situation when person, which is registering to the company's ...
0 votes
3 answers
42 views

Is there a way to "escape" HTML styles in AMP script

We have some basic content blocks with AMP script that we use in our emails (ContentBlockByID). The following AMP script is used: %%[ if @XXXX == 'XXXX') then set @text = 'Some text' else set @text ...
  • 107
0 votes
0 answers
38 views

TreatAsContent Issue

Is there really a risk in using TreatAsContent() (I can remember an issue before that is something about it caching but cannot fully remember now) especially when used together with ClaimRow()? Is ...
0 votes
1 answer
39 views

AMPScript - Name is just an initial, not blank

We have a few customers whose name is just an initial in the DE. I'd like to personalize the subject line but don't want "Dear A,..." I have the code for if it were blank, but is there a way ...
0 votes
0 answers
46 views

Marketing Cloud Publication Lists not updating on Sales Cloud record

Apologies if this question has already been asked, but any advice would be greatly appreciated. I’m currently working with some AMPscript for a custom preference centre in Marketing Cloud. I’ve ran ...
0 votes
1 answer
35 views

Email description parsing through to SendLog [closed]

To pass the Email Name to the SendLog you need to add an AMPScript with "emailname_" system string to obtain that field. Is there a similar system string to pass the Email Description (the ...
  • 13
-3 votes
1 answer
54 views

Use of TreatAsContent( ) function? [closed]

I am trying to understand TreatAsContent function? Can anyone please elaborate in simple words about this function and which scenarios it might be useful? like e.g. I have seen online mentions about ...
  • 1
0 votes
1 answer
52 views

Not able to send JSON payload request to API end point using HTTPPOST2 ampscript

This is the RMM functionality we have implemented to capture customers response to our Marketing email and send that customer's response to an external API endpoint. We are trying to send Json payload ...
  • 29
-2 votes
1 answer
69 views

AMP Script - Populate last date of the third month in DD-MM-YYYY [closed]

set @todayUS = Now(1) set @tomorrowUS = DateAdd(@todayUS, 1, "d") set @yesterdayUS = DateAdd(@todayUS, -1, "d") set @threeMonthsDate = dateadd(@today, 3, "M") set @month =...
0 votes
1 answer
22 views

Why is my data extension not being updated?

I have a subscriber and I want to update their surname. CloudPages processes this, but I do not see an update in my data extension. This is my code: %%[ if RequestParameter("submitted") ...
0 votes
1 answer
53 views

UpsertDE function is not working with raise error function

I am working on a case where I am updating the DE When a error is occurring. There are total 100 records in DE where I am making the UpsertDE operation, I can see this code always update the top two ...
0 votes
1 answer
28 views

Add variable to existing string

IF (@countryCode=="A") THEN @para1from = "America" ELSEIF (@countryCode=="I") THEN @para1from = "India" ENDIF SET @paragraph1 = "I am from %%=(v(@...
  • 107
0 votes
1 answer
86 views

How to retrieve JSON values from a Data Extension

I have a basic javascript for retrieving values. Like this: <script runat="server"> Platform.Load("core", "1.1"); var list = ["value1",&...
  • 107
0 votes
2 answers
75 views

Is there a way to parse JSON without names?

we have a simple JSON structure. This structure has no names like this: ["value1","value2"] Is there a way to parse/use this in Marketing Cloud? We don't have to make decisions. ...
  • 107
0 votes
0 answers
70 views

Create new Task in Salescloud using Ampscript Salesforce Marketing Cloud

When I create a new task using ampscript, a Task is created but 2 tasks are creating at a time. here is the code SET @id=CreateSalesforceObject('task',7,'WhatId',@opportunityid, 'OwnerId',@ID,'...
0 votes
0 answers
33 views

Live triggers are erroring out - "An error occurred when attempting to build an email for the subscriber"

I am able to preview the subscriber and also able to send test email for the particular subscriber, but the email is not getting sent through triggers. When case was raised, we got the comment, "...
0 votes
1 answer
39 views

Is it possible to retrieve Cloud Page User's Time zone?

I am trying to retrieve the time zone from a cloud page to populate and ICS file I am generating. The file is created fine, but the time is incorrect. Is it retrieve to pass the user's time zone so I ...
0 votes
1 answer
111 views

creating task in salesforce CRM using createsalesforceobject in MC

Here is the code... The problem is: 2 similar tasks have been assigned in the salesforce crm.. As i needed a single task to be assigned... Could not find where is the problem ... Please help me with ...
0 votes
2 answers
57 views

Using Ampscript to grab First Name when have full name in a field

We have a triggered send going out, and am getting a field called "CustomerFullName" the data comes in as LastName, FirstName MiddleInitial How can I use Ampscript to just pull the firstname?...
0 votes
0 answers
36 views

AMPScript - No column of the specified name was found but the field is present

I need to have different HTML rendered based on the value of a couple of fields in my DE. Except when I try to preview the email I get this error. Invalid column name (parameter 2) passed to Field ...
  • 11
0 votes
1 answer
37 views

Generating a File via Salesforce and using AttachFile() function in Marketing Cloud error

I recently turned on the Attachfile() feature within Marketing Cloud (and Public Links is enabled within Salesforce) and have been generating a HTTPS url link in Salesforce for testing. I am using the ...
0 votes
1 answer
85 views

Exclusion Script targeting previous day

Hello all I want to write an exclusion script where I omit people who were sent emails yesterday. Below is my code but it is not working and I think its because my entry source DE needs an eventdate ...
  • 125
1 vote
1 answer
35 views

Using Ampscript DecryptSymmetric function within SSJS

I am trying to get access token using SSJS, but to retrieve client id and client secret I want to use an ampscript function - DecryptSymmetric. When I use this function I get '500 - Internal server ...
0 votes
2 answers
57 views

AMPScript, rendering literal variable names

I’m trying to pull in variable values from a SSJS content block. I’ve looped over a base name to create incremental variable names. It is outputting the literal variable names in to the email as ...
0 votes
1 answer
29 views

AMPScript LookupOrderedRows and filtering/excluding based on value

I currently have an AMPScript block which is looking up values based on subscriberkey/client email, based on this displaying the results in an output table in the body of the email. (this is being ...
  • 3
1 vote
1 answer
33 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
28 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 ...
0 votes
2 answers
29 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
32 views

AMPscript - data extension data manipulation

I am currently having a problem with salesforce email personalisation using journey builder field personalisation. We are based in AUS and use dd/mm/yyyy format but the data pulling through from ...
  • 1
0 votes
0 answers
42 views

Shortening URL with BItly using JWT and page with #

I'm trying to use the HTTPGet function to retrieve a shortened url. I use this all the time and it usually works fine. But for some reason whenever I use a url with a # it returns the whole payload ...
  • 15
0 votes
2 answers
50 views

AMPscript LookupOrderedRows Error

I am trying to use the LookupOrderedRows function. I've followed the setup according to the AMPscript guide (https://ampscript.guide/lookuporderedrows/) but Marketing Cloud email preview is throwing ...
0 votes
1 answer
33 views

LookupRows returning an empty array

I am trying to return a row by using LookupRows but I can't seem to get past that as other functions that use my @rows variable throw an error. I am assuming it is because the LookupRows function is ...
0 votes
0 answers
30 views

SFMC MobileConnect QueueMO : Pass & Get addtional parameters

I am using the below request for calling the /sms/v1/queueMO from external website. Basic one - Working { "mobileNumbers": [ "1xxxxxxxxx" ], "shortCode": "xxxxx"...
0 votes
2 answers
60 views

Best Way to combine multiple lookup tables

I have 2 lookup tables. Table1 - Houses the email content and the lookup is on daymarker and language combination. Table2 - This is used to group multiple brands. (Brand1 can have multiple CID's, so I ...
0 votes
1 answer
26 views

Ampscipt "default" value

I have email content that lives inside a data extension. It populates the content based on a lookup, daymarker and language code concatenation. This works but occasionally there might be a new ...
0 votes
1 answer
33 views

How can I resolve ampscript variables in the @json payload when using GetJWTByKeyName ampscript function?

I want to configure a script that will dynamically populate variables in the @json payload of the GetJWTByKeyName ampscript function, based on the user data. I know the blow script isn't valid, but ...
  • 15
1 vote
1 answer
66 views

AMPscript and JS on the same submit action

I created a Landing Page in Marketing Cloud that basically consists of a form with checkboxes and a signature field. I have an AMPscript block that updates a salesforce fields based on the form ...
  • 13
0 votes
0 answers
35 views

AMPscript button to delete records

I working on a small project using HTML CSS and AMPscript to pull records from a Data extension and display it in a table which is already done but I want to make it possible to delete those records ...
0 votes
0 answers
27 views

Interactive Forms and CloudPage redirects to customer's language preference

I am using an interactive form where each field value is populated via AMPscript. This is so I can use one form and dynamically input the customer's language into the field values. With this setup, ...
0 votes
0 answers
51 views

Salutation rule is not working

I am currently working on Salutation rule. I made for English and German. However, Salutation for German is not working while English Salutation works fine. Can you guys help me to find where is the ...
0 votes
0 answers
37 views

How to join WhatsApp report with a re-entry anytime Journey DE

We want to gather information about each WhatsApp journey sends. So far I found that the only option to get sends status is using Chat Messaging Data Extract. I was also able to join it with a journey ...
  • 71

1
2 3 4 5
61