Discussions

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

    Posted 07-20-2021 16:34
    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 07-21-2021 13:48
    Whoops, I found it...should be loop.last, not loop.end.

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