Created
June 14, 2023 13:43
-
-
Save camrobert/3f02f01ca48296855fe5523b343d9683 to your computer and use it in GitHub Desktop.
Recreate the BuildRowsetFromJson Documentation Usage Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
SET @json = '{"Flights": [{"Origin": "IND","Dest": "NYC","Price": 100.0},{"Origin": "IND","Dest": "LAX","Price": 200.0},{"Origin": "IND","Dest": "SEA","Price": 500.0,"PerBagSurcharge": 25}]}' | |
SET @rows = BuildRowsetFromJson(@json, '$.Flights[*]', 1) | |
]%% | |
<table border=1> | |
<tr><th>Origin</th><th>Dest</th><th>Price</th><th>PerBag Surcharge</th></tr> | |
%%[FOR @i = 1 TO Rowcount(@rows) DO]%% | |
<tr> | |
%%[FOR @c = 1 TO 4 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