Alteryx Designer Desktop Discussions

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

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

mdorio
7 - Meteor

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

2 REPLIES 2
rafalolbert
ACE Emeritus
ACE Emeritus

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?

TarunDeep
8 - 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