In creating a set of records to help us print registration badges I'm attempting to force the page displays to insert a page-break div every 6th. record. I'm sure there are numerous ways to do this and hoping to get there quickly if possible.
</th...>
%%[ Var @rows, @row, @GUID, @Name, @Event, @Preference
SET @TableRows = LookupOrderedRows("Registrations" , 0, "RegisterDate Desc", "eventGUID", @eventGUID)
SET @TableRowCount = RowCount(@TableRows)
FOR @i = 1 to RowCount(@TableRows) do
SET @TableRow = Row(@TableRows, @i)
SET @GUID = Field(@TableRow, "RegID")
SET @Name = Field(@TableRow, "RegName")
SET @Company = Field(@TableRow, "RegCoName")
<tr class="labelBlock">
--- Add table rows and inserts fields - this part works but... ---
%%[ NEXT @i ]%%
So we're using that premise to create a table, but every 6th. record needs to be a tag primarily to create the required page breaks. My thought process leans towards a record count and every whole number multiple of 6 is followed by that Not sure how I'll do that but seeking other suggestions or methods.
Attribution to: Jonny Shaw
Possible Suggestion/Solution #1
Are you just looking for the AMPscript to do the multiple of six? The MOD operator should work.
%%[IF MOD(@i, 6) == 0 THEN ]%%
---Page break code
%%[ENDIF]%%
I don't have anything more elegant off the top of my head.
Attribution to: Timothy
This content is remixed from stackoverflow or stackexchange. Please visit https://salesforce.stackexchange.com/questions/30818