Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Using Run Command to Move files

Bland
5 - Atom

My goal is that after my workflow has ran. Alteryx would move the file into a different folder. So the workflow would run on "File A". Then once completed Alteryx would move "File A" into a different location.


How would I set something like this up in Alteryx?

 

5 REPLIES 5
MarqueeCrew
20 - Arcturus
20 - Arcturus

Hi Bland!

 

When you ask "How would I set something like this up?" the simple answer is:  It depends.

 

One way to solve this is to use the WORKFLOW CONFIGURATION and the "EVENTS" tab.  You can create an event that runs only upon success and it will run the run-command so that you can execute a STATIC batch file that moves the predicted output to a target directory.  This way, you'll only output data on success.

 

If you don't know the name of the file or target (maybe this is an analytic app or a macro), then you'll need to use the run command tool and will need to use actions to update the names of the data and target directories.

 

I'd be happy to help you build this functionality if you run into troubles.  Maybe if others would like to see this solved, we could see how many ways people solve the same problem.

 

Capture.PNG

Thanks,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
RodL
Alteryx Alumni (Retired)

I worked with a customer who had a workflow that created several files that were dumped into a folder, but then they wanted the files moved into a folder that didn't exist, but would be based on a date that was within the data.

We ended up using the Workflow Events as @MarqueeCrew mentioned, but because the new directory and files were "dynamic" in nature, we created a batch file each time it ran with a formula tool that dynamically changed the lines within the batch file.

Here are some screen shots of the setup that you might be able to use as an example to create your own process...

 

The actual batch file content:

MakeDir2.png

 

The Formula tool to create the batch:

MakeDir1.png

As you can see, some of the lines are just "hard-coded", but others use a field that is built dynamically off of the file name.

After the Formula tool, we used a Transpose tool to get the "lines" of the batch file "vertical" into the same single text field.

 

Then we used the Event to call that batch file:

MakeDir3.png

 

Hope this helps.

Pianalyst
7 - Meteor

Hi,

 

I am working on automating a webscraper system on a linux server to run every day and I want an alteryx workflow to run a script that starts the server scraper files which are in Python. I want alteryx to then automatically pull the files created by the python scrapers from the server using a ftp. The flow will be: 1) Start Workflow 2) run script using run command 3) download data files from server and append to historical database. I know there are two ways I can start this: using the run command tool first to run a batch file with command line scripts, or by using the Events feature of Alteryx to run the script before running the workflow. What I wanted to know is if, when the script is run through the run command or through the Event feature, will Alteryx wait to move on in the workflow until the script is competeley done running? In essence, I want to make sure the python scripts download and create all of the data files before alteryx goes on in the workflow to pull the files from the server. Any help is appreciated, Thanks!

 

Yuri

RodL
Alteryx Alumni (Retired)

Yuri @Pianalyst,

Sorry...just saw this follow-up question and that no one responded...

Alteryx will not wait for a batch file process to complete...there's nothing that "connects" an external process (like running a Python script) back to the workflow automatically.

A couple of thoughts...

Depending on what your process is doing, you could just have the data that is created by the script (assuming it is file-based) flow out of the Run Command tool, or your script could possibly create a "trigger" of some sort that would flow back out the Run Command tool.

In either case, you might play with the Block Until Done tool that does basically "hold up" data streaming through a workflow until all of the data has been received.

Maybe this will help.

martman
8 - Asteroid

H RodL

I have an issue with desktop scheduler not being able a access a network drive, this is because the scheduler runs as a scripted service it can’t see the drive. Is it possible to use the run command to mount a drive within a workflow?

Labels