Detour or ignore section of workflow if condition is not met and w/o throwing error?
- 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
See image of workflow snippet below. Can't really attach workflow and can't really fake it since it needs XML to parse.
#A (first parse tool) Parse Tool. It will generate NEW_FIELD_OuterXML -- if it is present (it may not always be present).
#B (the filter tool immediately after the parse tool -- and with the error badge in the image) Filter Tool checks to see if NEW_FIELD_OuterXML is present; if True then it sends the record(s) to be parsed.
- PROBLEM #1. If NEW_FIELD_OuterXML is NOT present (which may occur) the #2 Filter Tool throws and Error (impacting the entire workflow).
- PROBLEM #2 If New_FIELD_OuterXML is NOT present then every subsequent Parse Tool will throw and Error (since the fields to be generated by parsing NEW_FIELD_OuterXML will also not be present for later stages of this section).
What I have tried so far:
- I tried the Count Records approach. It does not work, because NEW_FIELD_OuterXML is still not present.
- A brute force approach using half a dozen or so Ensure Fields tool works, but there has to be something easier??
- I tried adding a Filter Tool before #A Parse Tool to filter the records hoping it would ignore this section, but #B Filter still throws the error (even with 0 records).
QUESTION: How can you halt, detour, ignore a section of a workflow if a field is not present -- and do so without throwing errors?
WORKFLOW IMAGE
Brute Force w/ Ensure Fields (6 more not visible)
- Labels:
- Help
- Tips and Tricks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hey @hellyars
There are Detour tools that are great for only passing data to tools of the active route (and the other tools won't error if they're missing a field). The detour control comes from a checkbox on the tool UI. However, since the decision to detour or not is coming from the data stream, you'll need to take a few more step to make this happen.
This is called a "Dynamic Detour" (when the decision is based on the data stream). My preferred method is to use a batch macro. Insert the detour tools in your workflow, then take that section and save it as a batch macro with the Control Parameter updating the detour. Then when you re-insert that into your workflow, dynamically determine if you need to detour and use that to update the Control Parameter.
Here's another good link to check out on dynamic workflows:
https://www.altertricks.com/expert/building-dynamic-workflows-with-detour-tools-or-updating-xml/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Will this work if used in Alteryx Server and not Designer. I tried using Message Tool, Error Tool, Test Tool and all three doesn't work on the server. An error still shows even when the condition to trigger the error is not met.
![](/skins/images/72080B1993C0EC7A53569ADF25905C2F/responsive_peak/images/icon_anonymous_message.png)