Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Dynamic Input error using ZIP Files from the Directory Tool

Karl_Spratt
8 - Asteroid

Hi Community,

 

Every day a get a system generated zip file ( It contains 1 csv file) which I save into a specific location on my C Drive

I was then going into the Workflow and manually and repointing the WF to the latest Zip file.  But I'd like to use the Directory tool to do this. Can some please help me?

Getting this error when creating the Directory steps: 

 

Error: Dynamic Input (110): Unable to open archive: C:\Users\kspratt\Documents\Colm Murphy\Rainer Project\1. Alteryx Files\PSH_xxascp_supply_demand_extract_report_4289289.zip

Like I say there is a CSV file with the actual data in this ZIP, and I want the dynamic to always run the WF on the latest ZIP FIle we save down. 

Sample of the Directory Paths are in Excel file

TIA,

Karl. 

 

Capture.PNG

5 REPLIES 5
MatthiasSeil
Alteryx Alumni (Retired)

For getting the .csv out of the .zip, you need to add the name of the csv to the full path with ||| (same procedure as with Excel Sheets - see screenshots).

 

Use Dynamic Input and Select zip as a file type, next use a formula tool in order to extend the full path with the csv filename. Set the Dynamic Rename to "Replace with entire File path".

 

For always taking the last zip file from the folder you could sort by creation date (as you already do) and then just sample the first record (see wf attached).

 

Hope this helps.

 

Cheers

 

Matthias

 

MatthiasSeil_2-1607701663114.png

MatthiasSeil_3-1607701925140.png

 

 

Karl_Spratt
8 - Asteroid

Hi Matthias,

Still getting an error,  my ZIP files all contain a CSV as explained but each day they get a different number appended to the end of the zip / csv, example today's file was xxascp_supply_demand_extract_report_4289536.zip and it is 

xxascp_supply_demand_extract_report_4289536.csv   but tomorrow's file might be xxascp_supply_demand_extract_report_42899999.zip etc. 

 

Error message is:

Error: Dynamic Input (142): Unable to open archive: C:\Users\kspratt\Documents\Colm Murphy\Rainer Project\1. Alteryx Files\xxascp_supply_demand_extract_report_4289536.zip

Attached my Directory part of the WF up to Dynamic Input.

TIA Karl

Capture.PNG

MatthiasSeil
Alteryx Alumni (Retired)

When looking at your workflow it seems that the filepath for the csv is not considered yet but only the one for the zip. Also the csv needs the full filename.

 

MatthiasSeil_0-1607717722755.png

 

 

When it is a general rule that the .zip file has the same filename than the .csv as in your example we can take this info from the directory tool output, replace ".zip." with ".csv" and then use this as the new filepath.

 

I've attached my revised WF once more.

 

Hope this helps.

 

Cheers

 

Matthias

 

 

Karl_Spratt
8 - Asteroid

Hi Matthias,

That worked, thank you for all your help.. 

Cheers,

Karl. 

Hey Matthias, I know this is an old topic but I'm struggling to import zip files as well.

I've tried to replicate the solution you proposed, but it's not working. I suspect that has something to do with how the file was compressed, it seems like it is inside several folders (see the attached image).

Cheers,

Carolina.

Zip_file.png

Labels