Is jinja template syntax still supported? #6295
-
Hello everyone, I'm having trouble looping elements and iterating over them. Having in context the items variable defined, something like this works:
But at the moment when there is a next: to be able to publish the items of that item, item() is None and there is no way to pass that data obtained to another action. In case jinja templates are still supported, and in particular loops, how could I do something like this?
Of course, this I've already tried but I get an error. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You should review how with-items functions because it does not operate like a typical programming loop. https://docs.stackstorm.com/orquesta/languages/orquesta.html#with-items-model Specifically:
In your example, |
Beta Was this translation helpful? Give feedback.
With items only allows for a result list to be produced by the action/workflow. The jinja block you showed as an example is not supported by stackstorm and is not how a workflow is parsed and evaluated so it won't work. Jinja blocks
{% %}
aren't supported either, only jinja statements{{ }}
.A workaround would be to write your own loop logic into multiple actions. The pseudo code: