It is possible to add conditional logic to the workflow actions, in this way you can indicate whether according to a condition, to continue with the execution or to end the workflow.
Criteria for use
- Use Twig Template conditions. You can read the documentation here.
- Variables inside the Twig Template don't need to be called again with braces. Instead of using
{{response_3}}
you should use:response_3
directly. - When the condition is met, the word "continue" must be specified since this is the criterion that the workflow takes into account to continue with the action.
Note: If the condition isn't met, the workflow will stop executing in its entirety.
______________________________________________________
Real Case Example: Consider a scenario where the trigger is "User completes a check-in" or "Form received new response/record," and you want to send a message only when a specific response is received.
Line by Line Explanation:
{% if response_2 == 'no-yet' %}
➝ Checks if the answer to question number 2 is equal to "no-yet."continue
➝ Essential for workflow continuation.{% endif %}
➝ Closes the condition.
Useful Examples:
-
Normal condition strictly evaluating the equality of values:
twig{% if response_2 == 'no-yet' %}
continue
{% endif %}
-
Two conditions evaluating the equality of values:
{% if response_2 == 'no-yet' and response_3 == 'ok' %}
continue
{% endif %}
-
Loop iterating a variable containing several values:
{% for assignees in input_event.payload.assignees %}
{% if assignees.username == 'Johanna' %}
continue
{% endif %}
{% endfor %}
-
Evaluating logic with different operators (e.g.,
!=
,<
,>
,<=
,>=
):{% if 'bc' in 'abcdef' %}
continue
{% endif %response_3
Notes:
- Access variables via "dots" (e.g.,
input_event.payload.assignees
). - Specify button values separated with a "dash" (e.g.,
response_1 == 'no-yet'
).
{% if response_1 == 'no-yet' %}
- continue
{% endif %}
Got additional questions? Submit a new ticket.
Comments
0 comments
Article is closed for comments.