yesterday
Is there a method by which a URL can be checked within a recipe to see if the URL is valid?
I have a recipe that, among other things, is constructing a URL that should be a reference to an image based on one of the ID of a data element. The issue arises in that the image has not always been uploaded and the URL that should point to the image returns a 404 (Page Not Found).
The output of the recipe is a CSV file where each row contains what "should" be the URL to the image, but (in some cases) the image has not been uploaded and the URL that it would have then throws a 404.
I did find a App Script for Google Sheets that will check the URLs - but this requires importing the CSV into Google Sheets, adding in the App Script, adding a column that then uses the App Script function to return the status of the URL. All of these are additional steps that I would prefer to avoid and merely do the URL checking within the recipe itself.
Is there a way to implement such a URL checker into a recipe in Workato?
yesterday
I get that completely - but I did not really see a way in which this could be done using Workato actions
9 hours ago
I agree on using Workato actions whenever possible, but I didn't really find a good way to check a URL by doing so. What did you have in mind as a way to do this using basic Workato actions?
7 hours ago
It's a two step process.
Here's a closer look.
Two actions:
Set up the HTTP action like the below. A GET request to a URL (you'll use a data pill since you'll be in a loop). Set the response type to "Text" so it doesn't try to parse the response (if it were set to JSON, it would crash).
Very important, set the below to "Yes". Usually when you receive a 404 the recipe will throw an error, but this will prevent the error and your recipe will continue.
In this step, simply log the status code data pill from the output of the HTTP action. This could be in a list variable or really anywhere/anything else.
In the HTTP action output, a 200/success will look like this:
And a 404 will look like this: