Is there a way to write the following as a loop in the response area of a webhook? Essentially, I want to get the size of the json and then count up to that number through 0,1…etc. I can do this in C using a json parser, but for teaching purposes, I would like to first demonstrate it as part of the webhook if possible.
{
“stop0”: “{{{data.0.attributes.current_stop_sequence}}}”,
“dir0”: “{{{data.0.attributes.direction_id}}}”,
“stop1”: “{{{data.1.attributes.current_stop_sequence}}}”,
“dir1”: “{{{data.1.attributes.direction_id}}}”,
“stop2”: “{{{data.2.attributes.current_stop_sequence}}}”,
“dir2”: “{{{data.2.attributes.direction_id}}}”
“stop3”: “{{{data.3.attributes.current_stop_sequence}}}”,
“dir3”: “{{{data.3.attributes.direction_id}}}”
}