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.
So I have my workflow outputting the appropriate string to a batch file and I'm trying to open that.
But now I'm even confused as to how I can run this batch file. I absolutely can't wrap my head around Write source, read source, etc. I just want to write this string to a command line and be done with it. No matter what I try I get some type of error that and input or output needs to be configured.
Side note: alteryx please fix the email tool, this is a ridiculous amount of side work to be doing just because you didn't include SMTP authentication.
As far as just running a basic batch file from the command tool, this works:
This was just a simple batch file: ECHO Hello; PAUSE;
You can pass arguments into it by using the command arguments option. I have a few of these inside batch macros so that I can pass the arguments in as control inputs.
The Write Source option allows you to take the data stream coming into the Run Command and write it to a file (so that whatever you end up running can use this data and you can ensure that it exists prior to running the command). This is a required option if you have data coming into the Run Command.
Read Results is for the opposite case, where whatever command you are executing create some sort of results file. You use the Read Results option to grab this results file and bring it back into the data stream for down stream processing. Read results is required if your run command output is connected to a downstream tool. Hope this helps!
So this is the batch file I'm trying to execute. Since it's sending an email I don't need to read in anything else, this is the end of the line.
The problem is my arguments are email sender, email receiver, and subject. From what I can tell I can't use variables to define the arguments in the run command tool. So I have a formula create the string I want to run in the command prompt and outputs it to a .bat file. Now all I have to do is open that batch file and I'm done.
I still get an error "Either an Output connection or Input connection is required.
To get rid of that error, hook the input of your Run Command to the end of your data stream, then set the Write Source to %temp%\temp.yxdb (basically just to satisfy the requirement that it is hooked to something, we'll output a file to the temporary file location).
Or use AdamR's method above (which is very elegant!) to create the batch file in stream, write it to the disk in Alteryx temporary storage, and then execute it.