Replies: 4 comments 3 replies
-
Having trouble with this as well within Button Actions. A switch/case statement that completes certain actions dependent on certain conditions. Continue if is somewhat useful but what if two separate branches are needed. (if result is 1 do this, if result is 2 do this). From my understanding it's not currently possible with the continue if action. |
Beta Was this translation helpful? Give feedback.
-
I quite like this because it uses a nested tree structure that users will already be familiar with from the component tree in the Design section. Nice mock-up! |
Beta Was this translation helpful? Give feedback.
-
Hi I have meet a case need call automation from an automation so I using automation block "call external query" to call this api to trigger another automation from an automation. POST https://budibase.app/api/automations/au_f6b9ee08a4be488b905fce10536ae478/trigger |
Beta Was this translation helpful? Give feedback.
-
Have added this for actions, please look here |
Beta Was this translation helpful? Give feedback.
-
Cases and Sub-Automations
I'm sure this has been suggested before, but something that would be really cool to see is a replacement for the "Condition" Automation step called, for example, the "Case" step. I will dive into the functionality, use cases, and consequences.
It would work similarly to a switch statement in JS. You can add as many cases as you want, for example:
Case 1.
{{ success }} = false
actionCondition 1
Case 2.
{{ result }} not in {{ list }} && {{ length result }} = 5
actionCondition 2
Case 3.
{{ result }} not in {{ list }} && {{ length result }} != 5
actionStop Automation
Case 4.
{{ result }} in {{ list }}
actionCondition 3
Perhaps this step would be constrained such that there can only be one and it must be the last step in an automation.
Then you could create or select a sub-automation to correspond with each case, as illustrated in the image below:
Call an Automation... within an Automation
Another enhancement that might be easy to add as a consequence of this change is the ability to call completely separate automations from within an automation. This has the potential to create loops, so maybe some advanced checking for loops would need to be employed. However, the benefit of adding such a feature would be to enable calling the same automation in multiple ways (app action, row change, etc.). There are other applications for that which I'm sure are obvious.
Conclusion, sort of
All of these changes would be immensely useful for making Automations involve less hassle. I find myself often making two very similar automations and changing the Condition step so that I can do two different things based on a certain result. I've also painstakingly recreated an automation identically, with the only difference being the activation method. I'm going through both of these things right now with my app and would really like to see Automations improved in this way in the future!
Also, the Automations list should be sorted alphabetically. I had to Inspect Element to get these Automations next to each other! Maybe I'll make a separate issue for that and try my hand at it.
Beta Was this translation helpful? Give feedback.
All reactions