Discussions

Expand all | Collapse all

Pipelines - Jinja FOR loop in body of webhook

  • 1.  Pipelines - Jinja FOR loop in body of webhook

    Posted 15 days ago
    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
    ------------------------------


  • 2.  RE: Pipelines - Jinja FOR loop in body of webhook

    Posted 14 days ago
    Whoops, I found it...should be loop.last, not loop.end.

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