Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Run Command tool in a Gallery App

RicardoOliveira
6 - Meteoroid

Hi folks,

 

I'm having some problems trying to use the run command tool inside a macro that is uploaded into a gallery app.

 

The macro is supposedly to read a write a file that is then post-processed by the macro itself. But it seems that this output file is not being overwritten when the app is ran. Lookig at the docs I saw that the Run Command cannot be used in a gallery app. Is this true even if I'm able to upload the workflow that has the macro?

 

The main logic of our app is to be able to run an external .bat file through a gallery app. Is there any alternative to acheive this?

 

Cheers,

Ricardo

6 REPLIES 6
patrick_digan
17 - Castor
17 - Castor

Hi Ricardo! Run command tools cannot be used in the Alteryx Analytics Gallery (gallery.alteryx.com); however they can be used in a private gallery (i.e. if you have an Alteryx server) assuming that your system setting is set to unrestricted mode.

 

1) Are you trying to run it in the Alteryx Analytics Gallery (won't work) or a private gallery (should work)?

2) Assuming you're in a private gallery:

    • can you run it successfully on your local machine?
    • check your workflow dependencies.
    • Have someone with access to the server check that it's running in unrestricted mode.

Hope that helps! If you can provide a sample of your workflow/macro/run command tool, I may be able to provide more assistance.

RicardoOliveira
6 - Meteoroid

Hi Patrick,

 

We are trying to run it on our private gallery, I always forget about the public gallery.

 

The workflow works as expected in Designer, with the output files being overwritten as it should. 

Run_command_setting.PNG

 

As you can see the ideia is that the .bat command will output a file called temp_out that will then be pros processed. This D drive is present in the machine running our alteryx server. 

 

I'm attaching here a package that has the macro and the workflow, the only thing not included is the .bat file since it has some internal addresses.

 

But as you can see the logic is pretty simple. The .bat file outputs a file and the macro must take this file and drag it down for post-processing so it can be returned to the user.

 

Thanks!

MarqueeCrew
20 - Arcturus
20 - Arcturus

When I save files within an application, I write them to specific directories on the server.  When saving an application to the gallery, there is a "Workflow Options" hyperlink that leads to "Manage workflow Assets".  That way I can specify exactly where the file will be located on the server within the configuration of targeted files.

 

You can read more about this at http://help.alteryx.com/10.5/index.htm#cshid=ModulePackager.htm

 

I am assuming that your batch file is looking for data in a specific location and that you are not finding the data when you save to the gallery.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
patrick_digan
17 - Castor
17 - Castor

Thanks Ricardo for clarifying! 

 

I assume that your server has access to D: and that you aren't packaging the run command output when you upload to the gallery? Your picture may look slightly different, but I just want to be sure you've unchecked the "(OUTPUT) D:\macro_app_test\temp_files\input_temp.csv"

Capture.PNG

 

Assuming that output is unchecked, is the D:\macro_app_test\temp_files\input_temp.csv file being updated when this is run from the gallery? If this file is being updated, then i would suspect something is going on with your bat file.

RicardoOliveira
6 - Meteoroid

It seems that the .bat file is indeed not writting to the temp folder. Is there a way to avoid the cmd window to close after the workflow fails? Maybe the .bat file is returning some rror message that would help me to debug it.

patrick_digan
17 - Castor
17 - Castor

I'm sure there is a better approach but I just add the "PAUSE" command to the end of bat files and then login to the server and see what goes wrong when my app runs.