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 bat file i wrote - that will automatically create different versions of an Excel template and put them in folder I want to use for my workflow however I cannot get the Run Command to work. Is there a placeholder I need to put somewhere to have it just execute and then move on to the next step? I am trying to use the Conditional Runner macro in conjunction with this to run different workflows in sequence.
This is the bat code:
for /f "tokens=*" %%a in ('type "filenames.csv"') do (
copy /y "template.xlsx" "../reports/%%a.xlsx"
If you're building the contents of the batch file in your workflow, you can use the Write Source output to create the batchfile. I like creating a comma-delimited output, but overriding with the \0 (no delimiter) option and turning off the "First Row Contains Field Names" option.
If you're running a pre-built batch file, the command you're running is "cmd.exe", not your batch file. Then the command argument would be the name of the batchfile -- "/c filenames.bat" will run the batch file...you can Google what the /c does.
I believe that the Run Command tool requires that either the Write Source or Read Results is configured. So if your batch file isn't built by the workflow, it needs to generate output that you want to read in, so use Read Results to bring it into your workflow.
The help for the Run Command tool should give you some guidance.
The bat file I wrote is not creating an output that I need as a source for workflow. I just want to trigger it to run so the appropriate files are copied into the results folder. and then move onto the next step. Can Run Command be used this way? I think I have seen other workflows that just start a bat file... this is still asking for both an input AND output even though it says they are optional.
Any thoughts? I know I am just missing a simple step - but this is the first time I am trying to use this particular tool.
Try configuring the Run Command tool to output something, like the contents of the runner macro. If you output to %Engine.TempFilePath%, it will get deleted when you close the workflow, so you can basically output anything and not have to worry about it.
Hope you are well! Although I have not writen outputs as bat files from the command tool, I have used this method to populate Tableau workbooks with excel spreadsheets, I think you should include your input and output template (which can be the same file).
For guidance on how to set this up I used the following two resources:
I was about to start a new thread, but your post is very closely related.
I have an Alteryx App that I'm developing for our company's Alteryx server. The output loads into our Tableau Server. I'd like to automatically send the user to that page on Tableau server after they've completed the app. I wrote a very simple .bat -- basically
I added this on the Run Command on Events on the workflow configuration to run after the workflow is complete. It works beautifully on designer, but nothing happens when I attempt to run it from server.
I know there are restrictions on command files when posting on the Gallery, but I don't know if that applies to company specific Galleries or just the Alteryx public one.