Forum Discussion

ChristopherWhe1's avatar
ChristopherWhe1
Qrew Member
3 years ago

Pipelines - Jinja FOR loop in body of webhook

Hello,

I'm trying to use a Jinja FOR loop in the body of a webhook, but I keep getting the following unknown error:



Here's the body of the webhook; I'm using the RESTful API. I've hidden the tableID.  "d" is the array of results from a previous step:

{"to": "tableID",
"data": [
{% for item in d%}
{
"6": {
"value": "{{loop.index0}}"
     }
}
{%if loop.end%}
{%else%}
,
{%endif%}
{%endfor%}
]
}

Anyone have thoughts?

------------------------------
Chris Wheatley
------------------------------

1 Reply

  • Whoops, I found it...should be loop.last, not loop.end.

    ------------------------------
    Chris Wheatley
    ------------------------------