community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
#SANTALYTICS

Gather all 9 clues to complete the final Weekly Challenge on Dec 16!

Learn More

I just wanted to execute a bat file I wrote

Asteroid

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. 

 

Image 526.jpg

 

This is the bat code:

 

for /f "tokens=*" %%a in ('type "filenames.csv"') do (
  copy /y "template.xlsx" "../reports/%%a.xlsx"

 

ACE Emeritus
ACE Emeritus

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.

Asteroid

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. 

 

Image 539.jpg

ACE Emeritus
ACE Emeritus

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.

Alteryx Certified Partner

Hi Aehrenwo,

 

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:

http://www.thedataschool.co.uk/lorna-eden/how-to-execute-tableau-from-alteryx/

https://www.interworks.com/en-gb/blog/mtreadwell/2016/03/03/using-alteryx-run-command-tool

 

Hope this helps,

Sasha

Highlighted
Asteroid

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

start http://tableauserver/myproject/etc

 

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.

 

Thanks.

Meteor

This is the only answer I have found to run a bat file from a Event. Thank you for that secret hand shake "\c"

2018-12-04 14_25_23-Analytics Server - Full Control.png

 

 

Labels