Skip to main content

Ternary Logic (If-Return)

The Ternary block is a compact way to make a decision and return a value based on that decision. It works like an inline if-else statement.

Test - Use If True - Use If False

This block takes three inputs:

  1. if: A condition to test (must return true/false).
  2. then: The value to return if the condition is true.
  3. else: The value to return if the condition is false.

Example

Setting a variable status_text based on a boolean is_ready:

  • If is_ready is true, set status_text to "Ready!".
  • If is_ready is false, set status_text to "Loading...".