Managing 404 response errors in the Alteryx Download tool
When browsing the internet you are likely used to receiving a ‘404 error’ when navigating to a website. This error is most commonly triggered when you have entered an incorrect URL.
When developing solutions using the download tool, the most likely reason a ‘404 error’ may persist is that you are dynamically generating URLs and have accidentally generated one that just doesn’t exist.
Fortunately, with Alteryx, there is a relatively simple solution for this, using the ‘message tool’ (an under used used tool IMO!).
In this example, I am connecting to an API which grabs historical world rugby ranking data from the World Rugby website.
I have inserted a ‘message’ tool immediately after the download tool.
I have then used a contains statement to check whether the words ‘HTTP/1.1 200 OK’ are contained within the resulting ‘Download Headers’ field from the download too.
!CONTAINS([DownloadHeaders],”HTTP/1.1 200 OK”)
I can change the message type depending on how I want to manage the resulting error; I want my workflow to produce a red error, and to stop passing any records downstream; for this action I choose the ‘Error – And Stop Passing Records Through This Tool’.
What I have also done in this instance, is kill the entire process (say should you have other streams of data in the workflow), by using the ‘cancel running workflow on error’ option which exists on the workflow configuration pane.
For the sake of showing you what this looks like, I have purposely messed around with the URL, and trimmed a few characters; now when I run the workflow I receive an error, and no data is transferred into my lovely DB 😀