If-Else
Run multiple bricks if a condition is met
Demos & Screenshots
No screenshots provided yet. Have some video demos or screenshots of this
brick
in the wild?
Send them over to
[email protected]!
How to Use
When adding the If-Else brick, two flows are added inside the brick: “if” and “else”. The bricks added to the “if” flow execute if the condition in the If-Else brick is true, and the bricks in the “else” flow execute if the condition is not true.
You can use a boolean variable for the condition, but another useful options is using nunjucks, for example, you can add {{”true” if @var ==”text” and @var2>5}} to only execute the “if” flow if @var is “text” or @var2 is greater than 5. This allows grouping with parentheses for more complicated conditions.
Check https://mozilla.github.io/nunjucks/templating.html for more information.
Inputs
Name | Required | Type | Description |
---|---|---|---|
if |
integration
|
The bricks to run if the condition is met | |
else |
integration
|
The bricks to run if the condition is not met | |
condition |
string, boolean, null, number |
The condition to check |
Outputs
Name | Required | Type | Description |
---|---|---|---|
No outputs for this brick defined. |
Details
ID | @pixiebrix/if-else |
---|---|
Author |
@pixiebrix
|
Version | 1.7.0 |
Created | June 2, 2022 |
Updated | June 29, 2022 |
Related Bricks
- No related bricks