Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for (nested) if/then Automation Flows - Implementation Suggestion: Condition = false skips steps rather than stops automation #13671

Open
thinkbig1979 opened this issue May 13, 2024 · 1 comment
Labels
bb-automations Budibase Automations related work enhancement New feature or request

Comments

@thinkbig1979
Copy link

Currently, the 'Condition' action step module completely stops the automation in its tracks if the result of the condition evaluation is false. This means that nothing you have in the chain after that even gets an input value, preventing you from running any further conditions.

This is what is output to the test runner console:

{   "success": true,
    "result": false,
    "refValue": "true",
    "comparisonValue": "false",
    "status": "stopped" 
}

Ideally, the condition step would allow the user to create a visual branch for the true and false outputs, but failing that, my suggestion would be the following:

IF the condition returns true
       THEN continue as normal.

IF the condition returns false, 
      THEN  
      Store a reference to that particular condition step in memory 
      Skip any automation steps following that step until 
      you reach a condition step that evaluates the result of the stored condition step.
      Continue the automation flow from that point. 

Given the fact that a condition only has two possible outcomes (true/false), evaluating it more than twice makes no sense anyway, and limiting the state to storing only the last actioned condition module is enough to do things like below.
That way you effectively allow for nested if/then conditions to be created without adding much complexity to the code.

  • step 1: Action
  • step 2: Condition
    • step 3: Action
    • step 4: Action
    • step 5: Action
  • step 6: Condition evaluating {{steps.2.result}}
    • step 7: Action
    • step 8: Condition
    • step 9: Action
    • step 10: Condition
      • step 11: Action
      • step 12: Action
      • step 13: Condition evaluating {{steps.10.result}}
    • step 14: Action
  • step 15: Condition evaluating {{steps.6.result}}
    • step 16: Action
    • step 17: Action
    • step 18: Action
@thinkbig1979 thinkbig1979 added the enhancement New feature or request label May 13, 2024
@ConorWebb96 ConorWebb96 added the bb-automations Budibase Automations related work label May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bb-automations Budibase Automations related work enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants