We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.

Workflow Powershell Script Works in Designer but not Gallery

discoverable1
6 - Meteoroid

I have a batch file in my workflow that runs a tabcmd command to export as csv to a folder "A". Then a powershell script that selects the columns I want, reorders them, and moves it to another folder "B". I then have another powershell script to convert that csv file to excel and move it to the final folder "C".

 

When I run the workflow in designer, it works perfectly. However, when I publish it to gallery and run it, only the tabcmd script (to folder "A") and first powershell script (from "A" to "B") works. The last one doesn't do what it's supposed to - it doesn't move it to the final folder (from "B" to "C"). I don't get an error in Gallery however, it says the workflow was successful. What could be my issue? It doesn't make sense to me how the workflow shows successful in both designer and gallery but where the powershell script works just fine in designer but not gallery. Please see attached for powershell script (--- to omit proprietary data)

6 REPLIES 6
discoverable1
6 - Meteoroid

Anyone? 😞

clarab
Alteryx
Alteryx

@discoverable1 , is the SharedDriveFolderPath accessible on the server?

 

Is there any Run As user set in the System Settings or on the Alteryx Service? If not, is there any workflow credentials used on the workflow. If this is none too, then the local system account is being used here which does not have the rights to access the shared drive. In this case, set a Run As account with the permissions to access the path.

 

You may want to check this How Workflow Credentials Work on a Private Gallery 

discoverable1
6 - Meteoroid

Gallery uses a service account id, and no workflow credentials are used on the workflow. I've checked the folder permissions and the service account id has full access to all the folders necessary. Tabcmd command runs and puts the file in a share drive folder. Then powershell scripts runs to select certain columns from that csv and saves that new csv in a folder one level up. Then powershell script runs to convert that csv to excel and save in a subfolder.

 

As mentioned before, it works locally in designer as my account. The gallery workflow works up until the csv to excel powershell conversion. I've also tried changing the destination path to the same folder as the selected columns csv location and it still doesn't work, so I don't think it is a permission issue.

clarab
Alteryx
Alteryx

@discoverable1 Could you try to debug your Powershell script by writing something out to a text file at each logical point in your script? This is to check the point of failure if any.

 

You may also want to review the following article:

https://community.alteryx.com/t5/Alteryx-Server-Knowledge-Base/How-to-enable-COM-object-on-the-serve...

danilang
18 - Pollux
18 - Pollux

Hi @discoverable1 

 

A vanilla install of Powershell, like you'd find on a server doesn't have the required libraries to read/write MS Office files.  The libraries would normally get installed once MS Office is installed, something that MS doesn't support or recommend on a server.  Vanilla PS can write csv files, though.  Maybe your csv to excel power shell script is silently failing because of the missing libraries.

 

This raises the the question of why you're calling PS scripts at all.  The operations that you're performing, selecting and reordering columns and saving to different formats and locations can all be accomplished in the main workflow without requiring PS scripts 

 

Dan

 

Nikita-Puniani
7 - Meteor

Hi,

 

I am experiencing similar issues. Were you able to get the powershell script working on alteryx server?