Skip to main content

Node: If/Else

The If/Else node is the conditional decision node of the Hashdata Workflow. It analyzes the content of responses collected up to that point in the flow and directs execution to one of two possible paths: True or False. With this node, you create smart workflows that automatically adapt to the content of responses, without needing manual intervention for each case.


When to Use

Use the If/Else node whenever your process needs to make different decisions depending on what was answered. Some common examples:

  • Automatically approve or reject a request based on a score or grade
  • Route to different teams depending on the department chosen by the respondent
  • Send distinct communications to VIP clients and regular clients
  • Check if a required field was filled before proceeding with a step
  • Compare dates or deadlines to decide if an action is urgent or can wait
  • Filter responses based on numeric criteria, such as budget value, quantity, or temperature

Whenever you identify that the next step of the process depends on the answer to a "what if?" question, the If/Else node is the right tool.


How It Works

When adding an If/Else node to the canvas, it automatically creates two outputs:

  • True — the path followed when the configured condition is satisfied
  • False — the path followed when the condition is not satisfied

Conditions are configured directly on the True output connection. When the instance reaches the node, the system evaluates the defined conditions:

  1. If the condition (or set of conditions) is satisfied, execution follows the True path
  2. If the condition is not satisfied, execution automatically follows the False path

The False path has no condition configuration — it is always the default path when none of the True path conditions are met.

About fields available in conditions

Conditions evaluate fields from ancestor forms in the workflow, that is, forms that have already been responded to in previous steps of the same instance. Fields from forms that have not yet been responded to will not be available for configuration.


Condition Types

When configuring conditions on the True output, you choose the field you want to evaluate and the logical operator appropriate for the data type.

OperatorApplicable toExample
Equal toText, numbers, single selection, multiple selectionField "Result" is equal to "Approved"
Not equal toText, numbers, single selection, multiple selectionField "Status" is not equal to "Canceled"
Greater thanNumbers, datesField "Score" is greater than 7
Less thanNumbers, datesField "Due date" is less than today
Greater than or equal toNumbers, datesField "Quantity" is greater than or equal to 100
Less than or equal toNumbers, datesField "Temperature" is less than or equal to 0
ContainsText, multiple selectionField "Observations" contains "urgent"
Does not containText, multiple selectionField "Tags" does not contain "test"
Is filledAny field typeField "Attachment" is filled
Is not filledAny field typeField "Justification" is not filled

Multiple Conditions

It is possible to combine more than one condition on the True output to create more precise criteria. When adding multiple conditions, you choose how they relate:

  • AND — all conditions must be true at the same time for the True path to be followed. Use when criteria are cumulative.

    • Example: Score greater than 7 AND field "Department" equal to "IT"
  • OR — at least one of the conditions must be true for the True path to be followed. Use when any of the criteria is already sufficient.

    • Example: Field "Priority" equal to "High" OR field "Value" greater than 50000
  • Custom expression — for more complex logic that mixes AND and OR in groups, you can define a custom logical expression referencing conditions by index. This allows creating structures like (1 AND 2) OR 3, where groups are evaluated in a nested way.

Chaining If/Else nodes

To create logic with more than two outputs, chain multiple If/Else nodes in sequence. For example: the first node checks if the score is greater than 9 (excellent); the False path of that node leads to a second If/Else that checks if the score is greater than 7 (good); the False of the second node represents scores below 7 (insufficient). This way, you cover as many scenarios as needed.


Practical Example

Imagine a quality inspection workflow for a production line. The process starts with a form filled by the inspector, which includes the field "Inspection Result" with the options "Approved" and "Rejected".

Here is how the If/Else node resolves this scenario:

  1. The trigger is activated upon receiving the response from the Inspection Form
  2. An If/Else node is added to the canvas right after the trigger
  3. On the True output, the condition is configured: "Inspection Result" is equal to "Approved"
  4. The True path leads to a Send Email node with a congratulatory message to the team, informing that the batch was approved and can proceed to shipping
  5. The False path leads to two nodes in sequence:
    • A Send Email node notifying the supervisor about the batch rejection, with the form details included in the message body
    • A Request Follow-Up node asking the inspector to detail the problems found and indicate corrective actions

With this configuration, the workflow automatically handles both scenarios without any manual intervention. Each instance follows the correct path based on what the inspector filled in.


Step-by-Step Configuration

  1. In the workflow canvas, drag the If/Else node from the side panel to the desired position
  2. Connect the previous node to the If/Else input
  3. Click on the True output connection to open the conditions panel
  4. Click Add condition and select the ancestor form field you want to evaluate
  5. Choose the operator appropriate for the field type
  6. Enter the comparison value (text, number, or date, according to the operator)
  7. If you need more than one condition, click Add condition again and define how they combine (AND or OR)
  8. Connect the following nodes to the True and False outputs according to your process logic
  9. Save the workflow and publish when ready

Best Practices

  • Name your nodes clearly to facilitate reading the flow in the canvas. Example: "Result Approved?" is more descriptive than just "If/Else"
  • Always connect both outputs (True and False). Leaving an output unconnected can interrupt the instance unexpectedly
  • Test with real data before publishing. Use form responses that cover both the true and false scenarios to ensure routing is correct
  • Avoid redundant conditions. If the same field was already evaluated in a previous node, check if it is really necessary to evaluate it again
  • Document the logic using the node description field when the condition is complex, especially in custom expressions with multiple groups

Next Steps

After mastering the If/Else node, explore other nodes that complement the conditional logic of your workflow: