Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
42 views

Ampscript UpdateSingleSalesforceObject Function in Loop

Im getting a 500 - error on my code and can't figure out whats causing it. Im trying to build a custom preference center (cloud page) that updates corresponding contact point consent records in ...
Daniel's user avatar
  • 1
0 votes
1 answer
123 views

What's wrong with my substring function?

I'm trying to loop through a string using AMPscript only and pick out specific values. The problem is once it tries to update the string using the substring function the cloudpage errors out. Example ...
smithky3's user avatar
0 votes
1 answer
110 views

Looping SSJS to output Ampscript variables partially works if I don't use a word building array function. Can't figure out why

I've got a data extension which has multiple rows for each item a user has in their cart and it's tied to their email address. The main issue is I need to cut off the product name at a max character ...
Erik B's user avatar
  • 65
0 votes
1 answer
900 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",&...
Martijn e's user avatar
  • 143
0 votes
2 answers
534 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. ...
Martijn e's user avatar
  • 143
1 vote
1 answer
68 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 ...
Connor Tom's user avatar
0 votes
1 answer
351 views

ContentBlockById and For Loop

I have a problem with this Loop because there are 8 rows in the DE and when I execute the code below, the preview only shows 6 content blocks. The last one it displays, also has a loop inside and ...
Constanza Sosa's user avatar
0 votes
1 answer
171 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 ...
Mahi's user avatar
  • 1
1 vote
1 answer
158 views

Three FOR loops in ampscript after reading from XML

I have an eReceipt issue. I am able to get the nested loop to work to display the promo amounts and descriptions when there is only one promo per item purchased. Where I am stuck is trying to add a ...
J. Smith's user avatar
0 votes
1 answer
449 views

AMPScript loop to concat only non empty fields in a row

I am trying to concat all the non empty field values from a row in my DE, into a single variable (each value in the concatenated string separated by a comma). The field names are: FIELD1, FIELD2 and ...
apples-oranges's user avatar
0 votes
1 answer
851 views

AMPscript LookUpOrderedRows and Loop: if statement to check all values of a field

I'm a real novice with AMPscript, and I have some that works for listing items on an order for one customer in one-to-many relationship. Now I have another challenge, and I need to add something to ...
kimchi's user avatar
  • 19
-3 votes
1 answer
575 views

Populate output of all values in the loop in SSJS

I have the following code and I would like to get all the values in that loop as output. Can someone tell me the function/process we use to get that result? <script runat="server"> ...
user85686's user avatar
0 votes
1 answer
243 views

for loop pulling through Array in to table

I'm trying to build a loop that goes through a field that contains multiple labels and values, the outputs are not correct and I can't figure out why. can anyone help? %%[ SET @str = "label:a,...
Peter Ho's user avatar
  • 515
1 vote
1 answer
891 views

Can Wait By Attribute honour the dynamic dates in Journey?

I have a 'Wait by Attribute' in my Journey which is referring to a date attribute in a data extension from contact builder. I then have a SQL criteria to change the Date values based on certain ...
Mano's user avatar
  • 11
1 vote
1 answer
975 views

Creating ampscript loop that will only show rows of data that contain a certain value

I have an xml field in a DE that contains order product data. I only want to show the products from that order that have an xml value ofclothing. Is there a way to write a loop to cycle through these ...
user55293's user avatar
0 votes
1 answer
200 views

AMPscript loop function Question

Thanks for taking your time to review my question. We have a complex situation that we need to use ampscript to display different content based on the webinar attendance. The data is stored in Three ...
Bryce Mi's user avatar
2 votes
1 answer
520 views

Concat Loop Results to determine if contains value

I have the following code to retrieve the series of a product that has been purchased. We are using a loop because a contact might purchase multiple products. %%[IF NOT EMPTY(@PersonAccountId) ...
SYUYDY's user avatar
  • 365
1 vote
2 answers
2k views

Ampscript FOR Loops results to retrieve product using a second Loop

I have 3 salesforce objects: - PersonAccount - MyWatches (Fields:PersonAccountId, ProductId, Status = Owner) - contains the list of watches bought by the PersonAccount - Product2 (Fields: Series) - ...
SYUYDY's user avatar
  • 365
1 vote
1 answer
1k views

LookupRows loop on Entry Data extension and Lookup Data extension

I have two data extensions. Entry Data extension | CONTACT_ID | +------------+ | 1 | | 2 | | 3 | +------------+ Lookup data extension +------------+-----------+ | ...
Martin Ho's user avatar
  • 107
0 votes
0 answers
387 views

'For' loop: using AMPscript block instead of inline

Our case is inserting multiple orders related to single Customer_Id. The ask here is that we would like to use a complete AMPscript block, if possible, instead of combining inline and block-style in ...
nix9247's user avatar
  • 538
1 vote
2 answers
943 views

Incrementing a SET Variable

I understand For loops, but I'm struggling trying to set n SET variables. Basically, what I'm trying to do is for each @i in a rowset, I'm trying to: SET @SegLocator (and concatenate @i to the end) ...
Robert Ricker's user avatar
0 votes
1 answer
806 views

AmpScript lookup function: Display data from multiple columns in a data extension?

I'm creating an email to display subscriber's order details. All the data is stored in one spreadsheet/data extension. The columns include OrderID1, OrderType1, OrderID2, OrderType2, OrderID3, ...
AbraMagic's user avatar
1 vote
0 answers
824 views

SSJS - Read a Data Extension after an Rows.Update

i'm now in my firsts baby steps in JavaScript on Salesforce Marketing Cloud. In my script i read one Data Extension with an DataExtension.Init("DE") and a DE.Rows.Retrieve(filter). After this, some ...
Pedro Pereira's user avatar
2 votes
0 answers
370 views

GTL Json data looping

I have a GTL code that loops through my JSON code. In the JSON string i have several order data but in each array there is the same adress information like so: [{ "name":"This is a name", "sku":"8547"...
Martijn e's user avatar
  • 143
2 votes
2 answers
2k views

Unique Values in Ampscript Loop

Is there a way to do a Loop where it only Loops through Unique values? Customer | Store John | 111 John | 123 John | 111 John | 100 Right now I have a basic loop where it matches on ...
Brian C's user avatar
  • 93
0 votes
1 answer
148 views

ClaimRow in a For loop

I want to give out more than one code in an email based on a number field in a DE. Currently, I'm using a for loop that goes from 1 to that number field, I have the claimrow within the loop, but for ...
Andrei Barany's user avatar
0 votes
2 answers
1k views

Ampscript won't let me set Field() in a For loop

I'm using the following bit of code to create a series of data extensions. I'm trying to create the name from a concatenation of Job_Ref and Creative_Name from a reference database. %%[ /*Using ...
TCassa's user avatar
  • 898
0 votes
2 answers
96 views

Value of a variable does not change - add function

We want to add +1 to the variable @times when the if conditions are true but the variable stays at 1 in our AMPScript. Following code causing me some headaches: %%[SET @times=1]%% %%[SET @one=1]%% %%...
Alexander Schmelzer's user avatar
0 votes
1 answer
3k views

Multiple rows using Loop in Ampscript

I want to print some rows in a table of the HTML email based on the count of rows (rowcount) that match the criteria. According with the number of rows, it have to show the number of informations. ...
Sergio Souza's user avatar
5 votes
4 answers
9k views

Loop Support in AMPscript

I'm very comfortable with using for loops in AMPscript. However, someone recently mentioned that other loop contexts are supported, similar to JavaScript, which offers: for - loops through a block of ...
Eliot Harper's user avatar
  • 16.7k
0 votes
1 answer
614 views

AMPSCRIPT - Lookuporderedrows - exclude value that have already been displayed

EDIT: Works like a charm with this code. I'd like to add a new condition to the if empty(@prevProductName) or @productName != @prevProductName then set @prevProductName = @productName I tried if ...
Emilie's user avatar
  • 55
0 votes
2 answers
449 views

Using FOR Loop to pull specific row and all subsequent rows from a lookup

I've been having some difficulty getting my loop to work properly and was hoping someone could take a look. The campaign is a recipient is assigned a tier (in this case 1-8), the audience data ...
J. Runberg's user avatar
0 votes
1 answer
66 views

Dynamically Populate LoopupRows()

How could I retrieve values from several columns that are in a row and there various combination of values (key1 = col1, col4, col5), (key2 = col3, col5), (key3 = col3) I have a Data Extension with ...
dmcs14db's user avatar
0 votes
1 answer
417 views

Conditional statement for the last occurrence of an AMPScript loop

I'm trying to remove the border only for the last time [content] shows up in a loop. A user can have anywhere from 1 to 3 rows showing. How would I set a conditional statement just for the last ...
Hanna's user avatar
  • 27
0 votes
1 answer
38 views

Make a looped row disappear based on criteria pulled from the loop?

The below code is a simplified version of my code which works (Landing Page), it includes all the rows I want, however, when I parse the row of data to "ExtranetApprovals" and come back to this page, ...
SophieLouise's user avatar
1 vote
1 answer
138 views

FOR LOOP problems - keep getting error

I'm having trouble getting my loop to work. High-level, I'm trying to ask customers to fill out their preferences if the preference field is blank, and if not blank, display what was selected. Easy, ...
user7827's user avatar