Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

How to stop workflow if file not found

prpanw
8 - Asteroid

I have a workflow and  that is scheduled. I  have used DYNAMICE INPUT tool to import last updated file but the problem is  sometime source data not updated due to technical issue and workflow run with previus day updatd file which  is incorrect. I want a condition if file name ( workview reprot mm.dd.yyyy) if not found then workflow stop.

3 REPLIES 3
craigja
10 - Fireball

2 Options

  1. If you know the filename and that it has the date at the end, then use a formula tool to build up the filename and pass that into the dynamic input, then if todays file is not there, it wont run and will error
  2. Use the Directory tool, get a list of all files in the directory, filter the files to look for one with todays date in the filename or created date, again, if no file for today, the workflow will error
DanM
Alteryx Community Team
Alteryx Community Team

@prpanw Take a look at the Message tool. You can create exactly what you are looking for. What you will do is create an error message in the tool based on your requirements as you mention after your Input Tool. So you'll have a second stream coming out of the Input tool. Then in your workflow configuration window (click on the canvas) in the Runtime settings you will see that you can cancel the workflow upon an error. This will then stop the workflow based on your message tool which is creating the error.

Raj
16 - Nebula

@prpanw i think you should add a filter tool before the dynamic tool to check the creation date of the file 
if the date is today of no conditions are meet this will push no records further and this will stop.

you can use this method and even add a message tool if the sum of record  is 0 this will flag a error message.

hope this help.

Labels
Top Solution Authors