Dev Space

Customize & extend the power of Alteryx. SDKs, APIs, custom tools, and more!
SOLVED

problem converting, unziping, changing version, and zipping back up a yxzp file

Highlighted
Alteryx Certified Partner

My Organization uses 2018.4, Although we have access to all current versions. As you know, YXZP files are not backward compatible because these are zip files that Alteryx can recognize. I created a macro/application that utilizes PowerShell ran from a CMD tool. This converts a YXZP file to a ZIP file, then expands the archive directory, allowing us to edit the XML data of the workflow in Alteryx (changing the VER “2019.x” to “2018.4”), lastly re-zips the package and changes the extension back to YXZP.

 

It works terrific; there is one problem I encountered under development. This is, when you double-click the YXZP package (after the process is complete), Alteryx goes through its standard import, but in the end, it doesn’t ask you to load the workflow?

 

Some aspects of the workflow are:

(1) The organization does not allow PowerShell to be run from external applications (this is a scripting setting in power shell that is controlled from an admin level). 

(2) you can, however, run power shell scripts from the CMD terminal, by starting your line with PowerShell -command. 

 

I believe the issue is when Zipping back up the directory using a compress archive function available in PS V5, we miss out on some settings or configuration in the YXZP file itself where alteryx asks to load the package after import. Has anyone encountered something similar, or know something involving ZIP/YXZP extensions that allow alteryx to load after import?

 

The CMDs work and are executed in this order.

 

  1. rename "C:\Users\Name\Downloads\challenge_167_start_file.yxzp" "challenge_167_start_file.zip"
  2. powershell -noprofile -command "Expand-Archive C:\Users\Name\Downloads\challenge_167_start_file.zip" -DestinationPath "C:\Users\Name\Downloads\challenge_167_start_file"
  3. Edit of Workflow XML here
  4. del C:\Users\Name\Downloads\challenge_167_start_file.zip
  5. powershell -noprofile -command "Compress-Archive C:\Users\Name\Downloads\challenge_167_start_file" -DestinationPath "C:\Users\Name\Downloads\challenge_167_start_file.zip"
  6. rename "C:\Users\Name\Downloads\challenge_167_start_file.zip" "challenge_167_start_file.yxzp" 
  7. rmdir /q /s "C:\Users\Name\Downloads\challenge_167_start_file"

This should happen after import:

Spoiler
alteryx import.PNG

However, this happens 

Spoiler
Alteryx no import.PNG

 

 

 

Highlighted
Alteryx Partner

I got a crazy idea for you. How about not converting to zip from YXZP at the beginning? I don't. I always can unzip straight from a yxzp. Not sure how powershell handles it but are you stuck with powershell only? I just know that if I am manually right click on something like 7zip it will extract it straight from yxzp. makes sense? 

 

Let me know if that helps Alteryx remember that its an Alteryx file and therefore knows to try and load it. 

 

Thanks

Joshua

Highlighted

@tug01519 There is a "comment" field that has to be set to the workflow name. I can check the comment field using 7-zip. See this post here. Assuming you're not changing any file names, could you skip your delete step (4) and use an -Update flag in your step 5? That way you can use the comment from the original yxzp. I don't know powershell so I'm just guessing. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive?vie...

Highlighted
Alteryx Partner

@patrick_digan are you using 7zip via command line by chance? 

Highlighted

@joshuaburkhow I have used 7-zip via command line in the past for some basic unzipping. I think I more or less tweaked some code that @jdunkerley79 had written a few years back.

Highlighted
Alteryx Certified Partner

This worked! Wonderful, thank you so much! that is some real problem-solving!