Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save camrobert/d73c07d5f5f0af6bd4d2f845b4297fb1 to your computer and use it in GitHub Desktop.
Save camrobert/d73c07d5f5f0af6bd4d2f845b4297fb1 to your computer and use it in GitHub Desktop.
%%[
SET @json = '{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateDoc(a)"},
{"value": "Open", "onclick": "OpenDoc(b)"},
{"value": "Save", "onclick": "SaveDoc(c)"}
]
}
}}'
SET @rows = BuildRowsetFromJson(@json, '$.menu.popup.menuitem[*]', 1)
]%%
<table border=1>
<tr><th>name</th><th>email</th></tr>
%%[FOR @i = 1 TO Rowcount(@rows) DO]%%
<tr>
%%[FOR @c = 1 TO 2 DO]%%
<td>%%=Field(Row(@rows,@i),@c)=%%</td>
%%[NEXT @c]%%
</tr>
%%[NEXT @i]%%
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment