This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
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)
@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.
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.
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