Skip to content

Conditional

formatting...

Module contains step implementations for the Conditional task.

Else

Change state of Conditional task instance created by Conditional if so that any following tasks will be run when condition is false.

See Conditional task documentation for more information.

Example

When condition "{{ value | int > 0 }}" with name "value-conditional" is true, execute these tasks
Then get request with name "get-when-true" from endpoint "/api/true"
Then parse date "2022-01-17 12:21:37 | timezone=UTC, format="%Y-%m-%dT%H:%M:%S.%f", offset=1D" and save in variable "date1"
But if condition is false, execute these tasks
Then get request with name "get-when-false" from endpoint "/api/false"
Then end condition

End

Close the Conditional task instance created by Conditional if.

This means that any following tasks specified will not be part of the conditional.

See Conditional task documentation for more information.

Example

When condition "{{ value | int > 0 }}" with name "value-conditional" is true, execute these tasks
Then get request with name "get-when-true" from endpoint "/api/true"
Then parse date "2022-01-17 12:21:37 | timezone=UTC, format="%Y-%m-%dT%H:%M:%S.%f", offset=1D" and save in variable "date1"
But if condition is false, execute these tasks
Then get request with name "get-when-false" from endpoint "/api/false"
Then end condition

If

Create an instance of the Conditional task which executes different sets of task depending on condition.

Also sets the task in a state that any following tasks will be run when condition is true.

See Conditional task documentation for more information.

Example

When condition "{{ value | int > 0 }}" with name "value-conditional" is true, execute these tasks
Then get request with name "get-when-true" from endpoint "/api/true"
Then parse date "2022-01-17 12:21:37 | timezone=UTC, format="%Y-%m-%dT%H:%M:%S.%f", offset=1D" and save in variable "date1"
But if condition is false, execute these tasks
Then get request with name "get-when-false" from endpoint "/api/false"
Then end condition

Arguments

Name Type Description Default
condition str

jinja2 template that renders into a boolean

required
name str

name of the conditional, will be used in request statistics

required