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 am using the Run Command tool at the end of a workflow to execute a very simple python script which is fixed. That is, the script doesn't change dynamically. I've finally got it to work, but with much frustration - very 'un-Alteryx' given that I'm used to things being obvious and pain-free
Question 1 - Why does the Run Command tool oblige us to have something in Write Source [Optional] box? After much frustration and digging around I eventually read that we can just shove %temp%\e.1 in there and be done with it. This seems to have no purpose in this scenario, so what value does it add?
Question 2 - Why do I need to put quotes around my Command Arguments .py, but not the location of the python executable? If I don't include the quotes I get this error: Run Command (3) The external program "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" returned an error code: 2
This is inconsistent and confusing. I'm sure there's a good reason for it, but combined it makes the Run Command painful to use for newbies, or for people who use it rarely (like me!).
Your post has very valid comments. For many, the Run Command tool holds many mysteries. I noticed that in release 2020.2, an example workflow for the Run Command tool has been added, which might help with the use of it. When you click on the tool in the Developer palette, there's a link to Open Example.
I believe the answer to your first question is addressed in the More Info help text in that Example. So you have to put something in either Write Source or Read Results.
As for question 2, here's my theory: Think of Command Arguments as in the arguments in a DOS command like Copy or Move. These commands have 2 arguments separated by a space, but if argument 1 or argument 2 has spaces in them, you need to tell the Copy or Move command that those spaces are not separators between arguments. To do this, you put each argument in quotes like this: