Skip to main content
added 22 characters in body
Source Link
Lukas Lunow
  • 22.2k
  • 4
  • 27
  • 59

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @allDate = 1 to @rowCount do

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

    if @allDate == 1 then
     outputline(concat("<p>"))
    endif
     

    ]%%

   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[if @allDate == @rowcount thenoutputline(concat("

"))endifnext @i]%%%%[ else ]%%No rows%%[ endif ]%%

%%[
var @rows, @row, @rowCount
var @lookupValue
set @lookupValue = AttributeValue("evtStart") 


set @lookupValue = "Friday" 
set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue)
set @rowCount = rowcount(@rows)



if @rowCount > 0 then

    for @allDate = 1 to @rowCount do


/* --- set the var for the rows you want to display --- */
        var @ProductCode, @ProductName, @Credits
        set @row = row(@rows,@allDate) 
        set @ProductCode = field(@row,"ProductCode")
        set @ProductName = field(@row,"ProductName")
        set @Credits = field(@row,"Credits")

        if @allDate == 1 then
         outputline(concat("<p>"))
        endif
         

        ]%%

       <p style="text-align: left">
Product Name is %%=v(@ProductName)=%%
         <br>  
      Product Code : %%=v(@ProductCode)=%%
         <br><br>
         Credits = %%=v(@Credits)=%%
       </p>
        %%[ 
        if @allDate == @rowcount then
          outputline(concat("</p>"))
        endif
    next @i 
]%%
%%[ else ]%%
No rows
%%[ endif ]%%

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @allDate = 1 to @rowCount do

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

    if @allDate == 1 then
     outputline(concat("<p>"))
    endif
     

    ]%%

   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[if @allDate == @rowcount thenoutputline(concat("

"))endifnext @i]%%%%[ else ]%%No rows%%[ endif ]%%

%%[
var @rows, @row, @rowCount
var @lookupValue
set @lookupValue = AttributeValue("evtStart") 


set @lookupValue = "Friday" 
set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue)
set @rowCount = rowcount(@rows)



if @rowCount > 0 then

    for @allDate = 1 to @rowCount do


/* --- set the var for the rows you want to display --- */
        var @ProductCode, @ProductName, @Credits
        set @row = row(@rows,@allDate) 
        set @ProductCode = field(@row,"ProductCode")
        set @ProductName = field(@row,"ProductName")
        set @Credits = field(@row,"Credits")

        if @allDate == 1 then
         outputline(concat("<p>"))
        endif
         

        ]%%

       <p style="text-align: left">
Product Name is %%=v(@ProductName)=%%
         <br>  
      Product Code : %%=v(@ProductCode)=%%
         <br><br>
         Credits = %%=v(@Credits)=%%
       </p>
        %%[ 
        if @allDate == @rowcount then
          outputline(concat("</p>"))
        endif
    next @i 
]%%
%%[ else ]%%
No rows
%%[ endif ]%%
added 16 characters in body
Source Link

I created this simple test but it just seems notwould like to be workinginsert a loop within a loop, I am trying to pull data from another DE thatthis is not linked to the email:working first loop pulling in content from an external DE, how would I loop this over again?

---- updated working script below ------

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @allDate = 1 to @rowCount do

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

    if @allDate == 1 then
     outputline(concat("<p>"))
    endif
     

    ]%%

   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[ if @allDate == @rowcount then outputline(concat("

")) endif next @i ]%% %%[ else ]%% No rows %%[ endif ]%%

I created this simple test but it just seems not to be working, I am trying to pull data from another DE that is not linked to the email:

---- updated working script below ------

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @allDate = 1 to @rowCount do

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

    if @allDate == 1 then
     outputline(concat("<p>"))
    endif
     

    ]%%

   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[ if @allDate == @rowcount then outputline(concat("

")) endif next @i ]%% %%[ else ]%% No rows %%[ endif ]%%

I would like to insert a loop within a loop, this is the working first loop pulling in content from an external DE, how would I loop this over again?

---- updated working script below ------

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @allDate = 1 to @rowCount do

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

    if @allDate == 1 then
     outputline(concat("<p>"))
    endif
     

    ]%%

   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[ if @allDate == @rowcount then outputline(concat("

")) endif next @i ]%% %%[ else ]%% No rows %%[ endif ]%%

added 1007 characters in body
Source Link

I created this simple test but it just seems not to be working, I am trying to pull data from another DE that is not linked to the email:

---- updated working script below ------

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

%%[for @allDate = 1 to @rowCount do
var

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

 @surname   if @allDate == 1 then
set @surname = lookup('test_DE_name','Surname',Surname  outputline(concat("<p>"))
    endif
]%%     

    ]%%
%%=v(@surname)=%%
   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[ if @allDate == @rowcount then outputline(concat("

")) endif next @i ]%% %%[ else ]%% No rows %%[ endif ]%%

I created this simple test but it just seems not to be working, I am trying to pull data from another DE that is not linked to the email:

%%[ 
var @surname 
set @surname = lookup('test_DE_name','Surname',Surname ) 
]%%
 
%%=v(@surname)=%% 

I created this simple test but it just seems not to be working, I am trying to pull data from another DE that is not linked to the email:

---- updated working script below ------

%%[ var @rows, @row, @rowCount var @lookupValue set @lookupValue = AttributeValue("evtStart")

set @lookupValue = "Friday" set @rows = LookupRows("WCOTW_final","evtStart", @lookupValue) set @rowCount = rowcount(@rows)

if @rowCount > 0 then

for @allDate = 1 to @rowCount do

/* --- set the var for the rows you want to display --- */ var @ProductCode, @ProductName, @Credits set @row = row(@rows,@allDate) set @ProductCode = field(@row,"ProductCode") set @ProductName = field(@row,"ProductName") set @Credits = field(@row,"Credits")

    if @allDate == 1 then
     outputline(concat("<p>"))
    endif
     

    ]%%

   <p style="text-align: left">

Product Name is %%=v(@ProductName)=%%

Product Code : %%=v(@ProductCode)=%%

Credits = %%=v(@Credits)=%%

%%[ if @allDate == @rowcount then outputline(concat("

")) endif next @i ]%% %%[ else ]%% No rows %%[ endif ]%%

source and link formatting, spelling
Source Link
Adam Spriggs
  • 31.1k
  • 6
  • 44
  • 88
Loading
added 5 characters in body
Source Link
Loading
Source Link
Loading