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

Alteryx Knowledge Base

Definitive answers from Designer experts.
 You are using an unsupported browser for translation. Please switch to another browser.

The Run Command tool is a great way to take your workflow to the next level of efficiency. It allows you to interact with the command line directly, just as you would if you were to access it manually and type in a command. Which is great because sometimes we have a lot of important things to do in the command line.
View full article
As currently designed, the  Amazon S3 Download tool  only allows one file, or object, to be read in at a time. This article explains how to create a workflow and  batch macro  that will read in the list of objects in a bucket and allow you to filter for the file(s) you want using wildcards!
View full article
This article describes an example of a simple logical test used to determine whether or not to kick off the second module with a workflow event.
View full article
API connections give access to many web-based applications, database systems, or programs by exposing objects or actions to a developer in an abstracted format that can easily be integrated into another program.
View full article
Amazon offers many different services that can be accessed from the AWS Command Line Interface (aka the AWS CLI). Alteryx workflows can take advantage of these services using the AWS CLI from the Run Command tool.   Some of the common uses of the Amazon CLI within Alteryx include: Using S3 with IAM roles Uploading/Downloading file types not currently supported by the S3 Upload / Download tools Interacting with Athena As an example of using the AWS CLI, let’s build a process that can take a local file and copy to S3, using an AWS IAM profile. Here are the steps involved: Review the documentation for the service. In this example, we're using the "S3" service, but Amazon has many different AWS services. Install the AWS CLI on any machines that will need to execute the AWS functions From Windows Command Line, create a working command (Optional step to make calling the CLI easier in the future) – Add reference to the AWS CLI executable to Window Environment variables via My Computer > Right Click > Properties > Advanced System Settings > Environment Variables > System Variables > Select “Path” > Edit > (Add the path to the directory of your installed “aws.exe” file, separated by a semicolon. Do not delete/modify any pre-existing values in the Path variable.) > OK > OK Per the AWS documentation, create a local profile using your IAM role. The local profile references your credentials so that you don't have to pass the credentials in every command. Test the following command in your Windows command prompt, making sure to use a valid local file to copy, and a valid destination location on your S3, and a valid profile name: s3 cp "C:\temp\mylocalfile.csv" "s3://mylocation/mydestinationfilename.csv" --profile MyIAMUser   Once you've validated your command in the command prompt, transfer it to an Alteryx workflow In a new workflow, pull in a “Run Command” tool from the “Developer” category Configure the Run Command tool using the working command:   Test the above As an optional step, we can wrap this functionality into a macro to make it easy to update, and to support batch uploads Add a Control Parameter for “Local File Path” and configure its action to update the specific string value “C:\temp\myfile.csv” Add a Control Parameter for “Destination File Path” and configure its action to update the specific string value “s3://mybucket/myfiletest1.csv” Add a Text Box and configure its action to update the command value “aws” in case the user hasn’t placed the CLI exe in their PATH variables The example above is attached in the 11.3 workflow, SaveToS3_usage.yxzp.
View full article
Question Can I read in an Excel file located in a zipped archive file from Amazon S3? Answer Unfortunately, this is not an option within the Amazon S3 Download Tool, as it only allows you to choose between CSV, DBF and YXDB files. However, this is possible within Alteryx with the use of a simple workflow utilizing a three line batch file, the Run Command Tool (master it here), and the AWS Command Line Interface (CLI).   In order to use the CLI, you must first download it and configure its settings. Please visit this page for information on how to do that. Once that is setup, you simply need to setup the batch file and configure the Run Command Tool.   Step 1 In the first step, you will use a Text Input Tool to write the batch file code. This code will use the CLI to copy the ZIP file from the S3 bucket to a locally accessible drive. Configure the Text Input Tool as follows:     Important: Make sure that line 2 points to where your CLI is installed. In line 3, replace "alteryxtest" with the name of your bucket, "ExcelTest.zip" with the name of your ZIP file and enter in the correct location to copy the file to.   Step 2 In the second step, you will use the Run Command Tool to do the following: Write out the batch file ("Write Source") Run the batch file created in the previous step ("Run External Program") Read the file into the workflow ("Read Results")   Important:  When entering in the "Read Results" section, your ZIP file will not exist at this point so you cannot simply navigate to and select the file. So, you have two options: Click on the "Input" button and enter in the full path of where you are copying the ZIP file (found on line 3 of the Text Input tool) along with the file name, a pipe character, and then in brackets, the sheet name. For Example: C:\Users\dchapman\ExcelTest.zip|ExcelZIP.xlsx[sheet1] Run the workflow once without the "Read Results" section completed in order to copy the ZIP file from the S3 bucket. Then, click on the "Read Results" button and navigate to the ZIP file and choose the Archive file to read it.    This same workflow can be used to read other archived files as well. However, you will have to make slight adjustments to the "Read Results" section of the Run Command tool. For example, if reading in a CSV file, you would simply include the archived file name. Since a CSV file does not have "sheets", the bracketed sheet name is not needed.   I plan to create a simple macro with a user interface that will do the same thing. Once complete, I will post it in the reply section.   Thanks for reading!
View full article
If you haven’t used the Run Command Tool just yet, that’s great. It means that whatever your analyses required, we had it covered with basic Designer functionality. But in spite of how great the Designer is, it just can’t do everything. There is a utility on your computer that can do just about anything, however, and it’s the command line . The Run Command Tool pairs the two into a dynamic tag-team duo that can wrestle all the computation you could need into one, integrated, Designer workflow:
View full article
Question Can I run my Python scripts in the Alteryx Designer? Answer Yes! We can use the Run Command Tool to do exactly that.   Below is an example, made in v10.6, demonstrating use of the run command tool to execute a Python script in the Designer and use its output in the workflow:     For a Python script, your Command should be Python.exe. If the directory where Python exists is in your system path variable, you can simply type Python.exe. Otherwise you will have to give it the full path, keeping in mind to quote the string if there are spaces (e.g. "Program Files"). In Command Arguments, you will type the location of your Python script (Alteryx's default working directory is the directory of the running module so it may be easiest to keep your script in the same folder to simply type "your_python_script.py" rather than the full path) and any - or -- options necessary. Remember to quote this string!   The example script from the attached simply sends text to a text file to be used as input for the Designer (note: it will not run unless you have configured your python environment):                                                                                                                 As you can see, we’ve successfully executed a python script and used the Read Results input to bring the result of the script into the Designer for further processing.
View full article
You'll notice some of the menus have been rearranged in version 10+. So if you are looking to export a workflow package, you will find that under the  Options  menu,   Export Workflow .  By default, you will see all the assets that the workflow depends on to run properly, but sometimes you will want to include additional files to package with the workflow.
View full article
Bulk load data into snowflake using the snowflake internal stage!
View full article
Building out a workflow and find yourself stumped when trying to add needed functionality to your process? While the Designer does an incredible job of packaging just about every operation an analyst could need, you might need that extra mile. We get that. Here at Alteryx we are all about going that extra mile; if we don’t have a tool that doesn’t explicitly capture functionality for you, we try to equip you with tools that can make for an easy reach to that functionality from resources just outside of the Designer environment (see our R Tool, the API based Connector Tools, and the Run Command Tool). In this article we’ll go over an introduction on how to make and use batch files – these will easily incorporate command line based scripting into your workflows that will help you do just about everything short of feeding your dog. In short, a batch file is a plain text file that lists a series of commands for the command line interpreter to run in Windows. They’re frequently used to make, remove, rename, move, or even copy directories or files, ping IP addresses, run other programs or services, and manipulate environment variables – and that’s hardly even the tip of the iceberg. There’s a wealth of resources online listing the different batch commands available to you, but the Ben/Peter Parker rule applies to them all: “with great power comes great responsibility.” Please use them responsibly!   To make a batch file, all you need to do is take your desired batch command(s) and write them into a text file:   Be sure to take note of the paths being used! This batch command will make a directory named “batchfolder” in whatever directory it is in when run. Before it can be run as a script, however, we have to save it as a .bat file: In “Save As” change the “Save as type” to “All Files (*.*)” and change the “File name” .txt extension to .bat: In your working directory you should now see a different icon, extension, and type, describing the file: How easy was that? If you want, you can test to see if it works by navigating to the directory the batch file resides in and typing its name into the Command Prompt:     You’ll now see the directory we made with the execution of the batch file: See, I’m not making this stuff up. Now let’s get all this set up to run for us in the designer. All you need to do is specify the .bat file name in the “Command” configuration option - by default, it will look for this file in the directory the workflow is saved in: In my v10.1 example (attached) I use the Run Command Tool as an input of a test file (specified in the “Read Results”) before writing the file to the new directory made from executing the .bat file.        
View full article
This is the third article in the series of renaming, moving, and deleting files using a batch file. This workflow will create a .bat file which you can use in other workflows that use the files you specify in this workflow to delete files.   WARNING: Please be careful using this command as it will do what it says it will do. Test thoroughly before adding to production.   Deleting Files   Creating the Batch file workflows: Tools needed: (1)Directory Input, (2)Select, (3)Formula, (4)Summarize, (5)Output Tools.   Directory Tool (1) – Browse to the file or files you are looking to change   Select Tool (2) – Fields you will need are Fullpath, Directory, and File Name   Formula Tool (3) – Output Fields Created: Command and Batch File. Create a new field, Command (String) – This is the field you want to build your command. Expression: 'DEL '+ '"'+[FullPath]+ '"'+ ' ' + + '"'+[FileName]+ '"' Sample Output - DEL "C:\Users\dmenke\Documents\Sample Data\Command Line Test\$200.xlsx" "$200.xlsx" Create a new field,   Batch File (String) – You will take the Directory field from the Directory Input and add a name of what you want the Batch File to be. Expression: [Directory]+’Delete_files.bat' Sample Output - C:\Users\JDoe\Documents\Sample Data\Command Line Test\rename_files.bat Summarize Tool – Select the Command field and the action will be to concatenate using a separator as \n. Select the Batch file and the action will be First. You can rename the Output fields if you choose as it will change the fields to Concat_Command and First Batch File.   Output Tool (5) – Browse to save file as any name you want (you will be replacing this name). You will want to use the Save as type: (.csv) and add .bat to end of the name. We want to transform that txt file to a bat file. In the Delimiters Row in the Options section add \0 as the delimiter. Select Take/Table Name From Field and choose Change Entire File Path. Select the First_Batch file (or name you called the field) in the Field Containing File Name or Part of File Name and unselect Keep Field in Output.     Adding Batch File to Your Workflow: The last step is to add this batch file to the Events tab in a Workflow that you want to move the file or files you have chosen in the .bat file in the Configuration window. Select Add > Run Command> Run Event When> After Run> Command: Browse to the bat file and click Ok.   See attached Sample Workflow.  
View full article
This is the second article in the series of using batch files to rename, move, and delete files. This workflow will create a .bat file which you can use in workflows that use the files you specify in this workflow to move to another directory.   Moving Files   Creating the Batch file workflows: Tools needed in order of use: (1)Directory Input, (2)Select, (3)Formula, (4)Summarize, (5)Output Tools.    Directory Tool (1) – Browse to the file or files you are looking to change                                          Select Tool (2)– Fields you will need are Fullpath, Directory, and File Name     Formula Tool (3)– Output Fields Created: Command and Batch File. Create a new field, Command (String) – This is the field you want to build your command. Note -The directory that you want to move the files to can be hard coded by adding the directory straight into the function or you can append another directory from another Directory tool before adding to the Formula Tool. In the sample, we hard coded the directory Expression:  'Move '+ '"'+[FullPath]+ '"'+ ' ' + + '"'+ 'C:\Users\jdoe\Documents\Sample Data\Command Line Move'+ '"' Sample Output - Move "C:\Users\jdoe\Documents\Sample Data\Command Line Test\$200.xlsx" "C:\Users\jdoe\Documents\Sample Data\Command Line Move" Create a new field,   Batch File (String) – You will take the Directory field from the Directory Input and add a name of what you want the Batch File to be. Expression:  [Directory]+'Moving_files.bat' Sample Output - C:\Users\JDoe\Documents\Sample Data\Command Line Test\Moving_files.bat   Summarize Tool (4) – Select the Command field and the action will be to concatenate using a separator as \n. select the Batch file and the action will  be First. You can rename the Output fields if you choose as it will change the fields to Concat_Command and First Batch File.   Output Tool (5) – Browse to save file as any name you want (you will be replacing this name). You will want to use the Save as type: (.csv) and add .bat to end of the name. We want to transform that txt file to a bat file. In the Delimiters Row in the Options section add \0 as the delimiter. Select Take/Table Name From Field and choose Change Entire File Path. Select the First_Batch file (or name you called the field) in the Field Containing File Name or Part of File Name and unselect Keep Field in Output.     Adding Batch File to Your Workflow: The last step is to add this batch file to the Events tab in a Workflow that you want to move the file or files you have chosen in the .bat file in the Configuration window: Select Add > Run Command> Run Event When> After Run> Command: Browse to the bat file and click Ok.   See attached Sample Workflow.
View full article
One of the many great things about Alteryx is how it can assist the user in organizing their data not only within the tool, but outside of the tool as well. In this series we will show you how to rename, move, and delete input files that you use in your Alteryx Workflows. You will create batch files with Alteryx that you will later be able to use in a workflow that runs the file. This will give you the ability to stay organized as to what you have run through the workflow.   The first one we will go over is Renaming Spreadsheets.   Renaming Files   Creating the Batch file workflows: Tools needed in order of use: (1)Directory Input, (2)Select, (3)Formula, (4)Summarize, (5)Output Tools.   Directory Tool (1) – Browse to the file or files you are looking to change   Select Tool (2) – Fields you will need are Fullpath, Directory, and File Name   Formula Tool (3) – Output Fields Created: New File Name, Command, and Batch File. Create a new field, New File Name (String) – Create the new name either by adding a name with quotes around it, from a field, or in like the example below, adding the runtime date of the file to the file name. Sample Expression of adding the run Date from Directory Tool as the renamed file:   Replace(left([FileName],findstring([FileName],'.'))+' '+tostring(DateTimeNow())+'.xlsx',':','-') Sample Output - $200 2016-03-04 09-00-43.xlsx Create a new field, Command (String) – This is the field you want to build your command. Expression:   'Rename '+ '"'+[FullPath]+ '"'+ ' ' + + '"'+[New File Name]+ '"' Sample Output - Rename "C:\Users\johndoe\Documents\Sample Data\Command Line Test\$200.xlsx" "$200 2016-03-03 13-23-53.xlsx" Create a new field,   Batch File (String) – You will take the Directory field from the Directory Input and add a name of what you want the Batch File to be. Expression:   [Directory]+'rename_files.bat' Sample Output - C:\Users\JDoe\Documents\Sample Data\Command Line Test\rename_files.bat   Summarize Tool (4)– Select the Command field and the action will be to concatenate using a separator as \n. Select the Batch file and the action will be First. You can rename the Output fields if you choose as it will change the fields to Concat_Command and First Batch File.   Output Tool (5) – Browse to save file as any name you want (you will be replacing this name). You will want to use the Save as type: (.csv) and add .bat to end of the name. We want to transform that txt file to a bat file. In the Delimiters Row in the Options section add \0 as the delimiter. Select Take/Table Name From Field and choose Change Entire File Path. Select the First_Batch file (or name you called the field) in the Field Containing File Name or Part of File Name and unselect Keep Field in Output.   Adding Batch File to Your Workflow: The last step is to add this batch file to the Events tab in a Workflow that you want to move the file or files you have chosen in the .bat file in the Configuration window: Select Add > Run Command> Run Event When> After Run> Command: Browse to the bat file and click Ok.
View full article
Are you tired of your boring old workflow? Just sitting there in your Designer, slacking off?
View full article
There are some command line statements that require you answer Y (yes) or N (no) before the statement will completely execute.  Case in point: let's say I want to delete files that are in a particular directory to clean up any files I no longer need (e.g. they are temporary work files), and I want to do this using a Run Command tool.   So I drag and drop a Run Command tool to my canvas.       And I configure the tool:     Since the Run Command is a stand-alone tool, I have to select 'dummy' output and input files.  In the command line I point to where command line executable file is located (C:\Windows\System32\cmd.exe in my case).  Then I add my command arguments.  '/C' carries out the command specified and then terminates.  DEL is the command to delete files and I specify the path where the files are located.  '*' is a wildcard character that will allow me to delete all the files in that path.   When I run the workflow, I get prompted with a question which requires a manual answer/input from me.      If I had set this up to run minimized and/or in silent mode, it is possible I wouldn't know I was being prompted for an answer.  How can you answer 'Y' in the command prompt automatically?  You need to turn echo off.  This can be done by adding '/Q' in the Command Argument like this:      Now when you run the workflow, it will automatically answer 'Y' and delete your files.   As an added bonus, there are many of these '/?' commands that can come in handy.  Here is a list of the more commonly used commands:   /C Carries out the command specified by string and then terminates /K Carries out the command specified by string but remains /S Modifies the treatment of string after /C or /K (see below) /Q Turns echo off /D Disable execution of AutoRun commands from registry (see below) /A Causes the output of internal commands to a pipe or file to be ANSI /U Causes the output of internal commands to a pipe or file to be Unicode /T:fg Sets the foreground/background colors (see COLOR /? for more info) /E:ON Enable command extensions (see below) /E:OFF Disable command extensions (see below) /F:ON Enable file and directory name completion characters (see below) /F:OFF Disable file and directory name completion characters (see below) /V:ON Enable delayed environment variable expansion using ! as the delimiter. For example, /V:ON would allow !var! to expand the variable var at execution time. The var syntax expands variables at input time, which is quite a different thing when inside of a FOR loop. /V:OFF Disable delayed environment expansion.  
View full article
We have a couple of great articles on uploading to an FTP location (File Transfer Protocol (FTP) Download and Automating File Transfer Protocol (FTP) Downloads). But what if these options do not work for you? There is another option you can try using the run command tool!   You can input your file you wish to upload and connect it to a run command tool or you can connect the run command tool at the end of your process when your data is read to be uploaded:     In the run command tool you will have to populate your output file in the Write Source section. You will also have to point to a .bat file that has the command for the run command tool, to upload to your FTP location. Lastly, if you wish to continue your process after your file has been uploaded you can choose to Read Results and you can connect additional tools/process to the right output tab of the run command tool:     Now, before this will work properly you will have to create your .bat file that houses the command for the run command tool in Alteryx to upload your file to your FTP. The .bat file will simply call on a .txt file that contains a script.   .bat file:     The contents of the script txt file is where all of the credentials and commands for uploading to your FTP are stored and will have to be constructed like the following:     Replace ftp1.extendthereach.com, username, password, and C:\filelocatoin\TestFile.yxdb with the correct info for your file and connection to your FTP. Once you have both your .txt and .bat file created, saved, and connected to in the run command tool you are all set to upload to your FTP!
View full article
Here in Customer Support, we like to make sure our workflows run as smoothly as possible. Sometimes you may ask yourself “Why can’t my excel file just open right after I output it?” Where there is a will, there’s a way.   Ladies and Gentleman I introduce to you the beautiful functionality of the Run Command Tool.   With this trick, you never have to go into the directory to manually open the saved file again. Note: There are multiple ways of doing this with the run command. This is just a simple example I created in version 10.1.   For this trick you’ll only need 5 additional tools. Before your output tool, you’ll need a Block Until Done Tool. This is for quality control as Excel doesn’t like to open when you are writing in to it at the same time. This prevents Alteryx from writing and opening at the same time. Next, you’ll need a Formula Tool, which will just add another field with your command. When making this dynamic, you’ll want to make sure you update both the path of your output and formula tool.   Whether you do that in a macro or app, it’s entirely up to you. After the formula tool, you’ll want a sample tool so that way we only select tool to deselect all the fields except for your command. Now just make sure your run command is set up properly. In this example it’s set to write out the command as a bat file and be read back in as a command.     To learn more about how to configure the run command, I would read though this helpful article. After you have this set, watch as your workflow has made your life even more automatic.
View full article