Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Check out our powerful new search update! You can read more here. Please let us know if you have any feedback by creating a topic here.
SOLVED

How to check if a file exists and if it does not then create it?

Highlighted
Meteoroid

Hello,

 

I am trying to write a workflow that checks a folder to see if it is empty or not.

 

If it is empty, then it would create a dummy file.

 

With my workflow I have 3 separate folders with input files, but for my process it should still run even if one folder is empty.  The workaround I am trying to do is to create a dummy file in that folder if its empty so my workflow stops breaking.

 

Any thoughts on how to do this?

 

Mike

Bolide
Bolide

Hi mdorio,

 

Creation of dummy files is not necessary if you use Directory tool to scan every of your dependency folders for metadata.

 

The 2nd folder below is empty and there is no record for any file, other folders present 2 and 1 files respectively and Dynamic Input tool only acts on files confirmed to be present in these folders.

 

img.JPG

 

Thanks,

Rafal

 

#Excuse me, do you speak Alteryx?

Highlighted
Asteroid

Hi,

 

Your solution works when there are 3 folders to read. If I have only one folder to read and it is empty then how to implement that scenario? The folder gives no results and workflow ends without any logic implemented. 

Labels