If statement else abort flow
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Dear community,
Is there a way to abort the flow if the IF-statements aren't true?
Like:
IF statement THEN X
ELSEIF statement THEN Y
ELSE abort (or error)
ENDIF
Thank you in advance!
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Help
- Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @Benjamin_TheCoder ,
You can do this by setting up a message tool. In this example I have put a basic condition that the lines have to follow, if not it will pop up the message but that wont stop the workflow (It will if it is an app).
To stop the workflow you would need to edit the runtime configuration tab by enabling stopping the workflow on error:
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @afv2688 for the answer.
That is the solution I currently have, which works great. But I was looking for an error message in the Formula-tool itself, to make my flow more dense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
What options we could have if I just need to abort one flow within the entire workflow process when there's zero records coming through.
For example,
Flow 1: A->B->C
Flow 2: D->E->F
C and F are combined to further down steps. Now the case I have is errors come up in flow 2 when there's no data coming through especially at tools like Filter, Join etc. because the filter key field/join fields are missing. So I just want to stop Flow 2 at a certain point when it's confirmed no data coming through, but Flow 1 and the combined flow will continue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @JokeFun ,
If I am correct, your question is: how can I stop a workflow if the value needed further down the workflow for it to run without error isn't in the data?
My answer is: that I don't know how to make that work because the tools in the workflow still require their input.
However, I might have a workaround that can help you. I solve this problem by adding the required values with a Text Input combined with a join. In the following image, you see two XML-Parse-tools. The first one outputs the field "openingBalance_OuterXML" if the value "openingBalance" is found. The second XML-Parse-Tool requires the field "openingBalance_OuterXML" to run. This field is not in the data because the workflow didn't find it in the first XML-Parse-tool.
To not let the workflow error so the rest of the workflow branches can still run, I have added the field manually with an Input-tool. It looks like this:
Because the values of the field are empty, it won't alter my data in a harmful way. Since further down the workflow, other tools also depend on the output of XML-Parse two; I need to repeat this workaround a few times.
I hope this helps. Let me know if I didn't fully answer your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your creative idea. It seems to be able to address my problem. Thank you! I will try this and update here if any further question.
