1

I am trying to use a non-sendable data extension as a source for building emails more easily. My exact steps:

I uploaded a .csv file with 5 columns (ProductName, Category, SKU, Price, and OrderFormat) and 9 rows (first row has headers, no special characters, very simple, OrderFormat column contained 4 different last names- one per row). I was following the steps outlined in this previous question. Here is my code:

%%[

VAR @catalog, @row1, @address
Set @address = AttributeValue('LastName')
Set @catalog = LookupRows('Catalog_DE', 'OrderFormat', @address)
Set @row1 = Row(@catalog, 1)

]%%

%%= v(@row1) =%%

I am sending this to a data extension with 4 subscribers, and each of their last names appear twice per row in the catalog data extension. When I test the email I get the following output=

System.Data.DataRow

What am I doing wrong?

Also, is it possible to use a non sendable data extension as a source for an email without having to match it to the data extension you are sending to? Ultimately we want to be able to upload a catalog in a .csv file and then just output the values.

UPDATE:

I updated my code after reading EazyE's answer:

%%[

%%[
VAR @catalog, @row1, @address
SET @address = AttributeValue('LastName')
SET @catalog = LookupRows('DE_Catalog','OrderFormat', @address)
SET @row1 = Row(@catalog, 1) 
]%%

%%= Field(@row1, 'ProductName') =%%

This code works great for when I want to personalize my email specific to each subscriber. However I also want to not have to personalize all emails I send. The only workaround that I have found was through changing the "OrderFormat" column's values to all 'X' and altering the code:

%%[
VAR @catalog, @row1, @address
SET @address = 'X'
SET @catalog = LookupRows('DE_Catalog','OrderFormat', @address)
SET @row1 = Row(@catalog, 1) 
]%%

%%= Field(@row1, 'ProductName') =%%

How can this be done?

1 Answer 1

5

You would need to leverage the field() function

You should reference this question 'AMPscript LookupRows Function Not Working' and also this question for examples

%%[

VAR @catalog, @row1, @address
Set @address = AttributeValue('LastName')
Set @catalog = LookupRows('Catalog_DE', 'OrderFormat', @address)
Set @row1 = Row(@catalog, 1)

]%%

%%= Field(@row1, "ProductName")=%%<br>
%%= Field(@row1, "Category")=%%<br>
%%= Field(@row1, "SKU")=%%<br>
%%= Field(@row1, "Prics")=%%<br>
%%= Field(@row1, "OrderFormat")=%%<br>
5
  • thanks now it works! Would it be possible to use the non-sendable data extension without having to link it to the sendable DE? In other words, without having to use the attribute value function
    – Intern
    Commented Jul 24, 2019 at 11:38
  • The audience for a send must be in a sendable DE or list. That can then be joined to whatever you need, but the source for addresses/contacts to send to must be a sendable entity. Commented Jul 24, 2019 at 13:49
  • @MarkDeHaven I guess what I'm asking is if there's a way to load the whole non-sendable data extension into the catalog variable, without having to look it up by building a where clause with a specific column and value. Is this possible? I'll update my question to clarify
    – Intern
    Commented Jul 24, 2019 at 18:03
  • You could add an additional field to your DE called Available and populate it with 1 and write your lookuprows LookupRows('Catalog_DE', 'Available', '1')
    – EazyE
    Commented Jul 24, 2019 at 18:21
  • @EazyE yea that's basically what I did with the 'X' thing. Thanks, I assume this is not possible to do then without this workaround..?
    – Intern
    Commented Jul 24, 2019 at 19:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .