Zoho Creator HTML Snippet - Can't get list to iterate

Zoho Creator HTML Snippet - Can't get list to iterate

Hi!

I'm trying to create an HTML Snippet on a page in Zoho Creator and would like to create an HTML table pulled from a list of time entries that I have in a form. I have successfully pulled the collection of time entries, but the code that I have built to put these entries into a table is only returning one row / one entry into that table. I'm using the "for each" function. Does anyone know if I'm doing something wrong?

This is the code:

<%
filteredrecords = Task_Details[Log_Date >= input.start_date && Log_Date <= input.end_date] sort by Log_Date desc;
for each  entry in filteredrecords
{
logdate = entry.Log_Date;
tasktype = filteredrecords.Task_Type;
tasknotes = filteredrecords.Task_Notes;
loggedhours = filteredrecords.Time_Spent;
entryid = filteredrecords.Time_Entry_ID;
tablebody = "<td>" + entryid + "</td>" + "<td>" + logdate + "</td>" + "<td>" + tasktype + "</td>" + "<td>" + tasknotes + "</td>" + "<td>" + loggedhours + "</td>";
}
%>
<table>
<tr>
<th>ID</th>
<th>Log Date</th>
<th>Task Type</th>
<th>Task Notes</th>
<th>Time Spent</th>
</tr>
<tr>
<td><%=tablebody%></td>
</tr>
</table>
<%

}%>