0

Is it possible to build the data extension as per my image below DataExtension

And then through AMPscript displaying the values from the rows for each individual email (Email 1, Email 2)?

Example being I want to change Content 2 in Email 2 and Email 4, then I just replace it in the data extension and upload the new file.

Reason why I ask is that when creating the data extension in ET, it ask you for the FIELDS, and these it reads from the columns, and not rows.

0

Sure. You could do something like this:

%%[

var @rows, @row, @rowCount
var @websiteName
set @websiteName = "Email 1" /* literal value */
set @websiteName = AttributeValue("Email 1 ") /* or value from attribute or DE column in send context */

set @rows = LookupRows("EmailContentDataExtension","Website Name", @websiteName)
set @rowCount = rowcount(@rows)

if @rowCount > 0 then

  var @shortURL, @URL, @Content1
  set @row = row(@rows,1) /* get row #1 */
  set @URL = field(@row,"URL")  
  set @shortURL = field(@row,"shortURL")
  set @Content1 = field(@row,"Content1")

]%%

<br>URL: <a href="%%=redirectto(@URL)=%%">%%=v(@URL)=%%</a> 
<br>shortURL: <a href="%%=redirectto(@shortURL)=%%">%%=v(@shortURL)=%%</a> 
<br>Content1: %%=treatascontent(@Content1)=%%

%%[ else ]%%

No content found for %%=v(@websiteName)=%%

%%[ endif ]%%

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.