I've run into an issue where I'm trying to pull all rows from an existing data extension using AMPscript in an email. I've been able to get a single row of the de, but I'm hitting a wall, when trying to pull multiple. I've tried assigning a default value to all rows in the DE and pulling all rows that have that value, but still haven't quite solved it.
My code below, Inbound is the field name I've set as the default of 1:
%%[
<br />
var @rows, @row, @rowCount, @Inbound, @i
set @Inbound = AttributeValue("Inbound")
set @inbound = "1"
set @rows = LookupRows("JumpStart_TestDE", "Inbound", @inbound)
set @rowCount = rowcount(@rows)
<br />
]%%
<style type="text/css">
body {font-family:Arial, Helvetica, sans-serif; font-size: 11px; }
table.Report { width:600px; margin: 20px auto; border:1px solid #000; padding 1px; font-family:Arial, Helvetica, sans-serif; font-size: 11px; }
table.Report td { border: 1px solid #ccc; padding: 3px 5px; }
h1 {font-size: 18px;</style><h1 style="font-family:Arial, helvetica, sans-serif;font-size:20px;color:#808080;line-height:100%;font-weight:bold;font-style:normal;">
Daily Report</h1><table class="Report">
<tr style="font-weight:bold;">
<td>
FirstName</td><td>
LastName</td><td>
Email</td><td>
SubmittedDate</td></tr></table>
%%[
if @rowCount > 0 then
for @i = 1 to @rowCount do
var @FirstName, @LastName, @CreateDateTime, @SubmittedDate
set @row = row(@rows, @i)
set @FirstName = field(@row,"FirstName")
set @LastName = field(@row,"LastName")
set @Email = field(@row,"Email")
set @SubmittedDate = field(@row,"SubmittedDate") ]%%
%%[ next @i ]%%
<table border="1" cellpadding="0" cellspacing="0" class="Report" style="width:500px;">
<tr>
<td>
%%=v(@FirstName)=%%</td><td>
%%=v(@LastName)=%%</td><td>
%%=v(@Email)=%%</td><td>
%%=v(@SubmittedDate)=%%</td></tr></table><br>
%%[ else ]%%
Nothing to report.<br><br>
%%[ endif ]%%