Don't forget to register for our panel discussion with Dean Stoecker, Amy Holland, and Mark Frisch occurring next Wednesday, June 1!

2022-05-26 Updates: Email: If you're not seeing emails be delivered from the Community, please check your spam and mark the Community emails as not junk. Thank you for your patience.

Alteryx Designer Knowledge Base

Definitive answers from Designer experts.

How To: Upload Local Files to Box

AlteryxProducts
Moderator
Moderator
Created

This article provides steps on how to upload locally saved files of any type to Box.  

 

Prerequisites

 

  • Alteryx Designer 
    • 21.3.3.63061 and later.
  • Box Tools
    • 2.2.0 and later.

Use Case 1Upload existing files to Box.

 

If you have a local folder where new report files are added every day, Box Output allows you to upload the content of this folder to your Box account.

 

Steps

 

  1. Create new workflow and add the following tools: 
    • A Directory tool
      • Use the Directory tool to list the full paths of all the files in the selected folders.

    • A Box Output tool 
      • Use the Box Output tool to write data to Box. In this case, use it to upload local files based on the path input from the Directory tool.
    • (Optional) A Filter tool
      • You can use the Filter tool to filter the Directory tool output. For example, you can set it to filter only the files updated yesterday.
  2. In the Directory tool, select the folder you want to upload files from.
    AlteryxProducts_0-1646751627806.png

  3. (Optional) If you want to use the Filter tool, connect it after the Directory tool, and select how to filter the files.
    AlteryxProducts_1-1646751729286.png

  4.  In the Box Output tool, authenticate, and then select the Upload File to Box option. Then, in the Source field, select the parameter that contains full path of the local files.
    AlteryxProducts_2-1646752807220.png

     

  5.  Lastly, select a destination folder where you want to upload the files. In the example below, we selected folder DynamicTest1 folder, and selecting it updates the destination in both the Target Path and the tree view.
    AlteryxProducts_3-1646753000799.png

     

Use Case 2Create new files with the Output tool and upload them to Box.

 

If your workflow creates new files and saves them locally, the Box Output tool allows you to upload these files to Box, all within the same workflow.

 

Steps

 

  1. Use an existing workflow or create a new one, and add the following tools: 
    • A Block Until Done tool
      • Use the Block Until Done tool to allow the Output tool to finish writing all the files.

    • A Formula tool 
      • Use the Formula tool to add a new column for the full path, including the timestamp.
    • A Unique tool
      • Use the Unique tool to provide one row of data per file to other tools.
  2. Set up your workflow to output the data you want. In this example, we’re using a simple Text Input for placeholder data.
    AlteryxProducts_0-1646756662754.jpeg

     

  3. As an example in the Formula Tool, we generate new file names and file paths for the files that will be created in step 5. We want it to contain the full path of the files, then some text including today’s date, and finally the files extension. Please note that the file extension must be supported by Output Tool in step 5.
    AlteryxProducts_0-1646756866238.png

     

  4. The Block Until Done tool makes sure that the highlighted part below will start executing only after the step 5 finishes. In our example, the Block Until Done tool ensures that the new file is always created first. Once it's created, the rest of the workflow will be executed.
    AlteryxProducts_1-1646756952809.png

     

  5. The Output tool creates new .csv files with the file name and the path defined in the step 3.

    In the dropdown at the top, select Write to File, and then at the bottom of the configuration panel, check the Take File/Table Name From Field box.

    Finally, select Change Entire File Path and select the field which contains the path.

    If you don't want the path to show up in your data, uncheck the Keep Field in Output box.

    AlteryxProducts_2-1646757024419.png

     

  6.  (Optional) To reduce the complexity of the workflow, use the Select tool to remove all data columns so that only Full File Path is passed as an output.
    AlteryxProducts_3-1646757059868.png

     

  7.  Use the Unique tool to remove any duplicates in the path so that each file is uploaded only once.
    AlteryxProducts_4-1646757088290.png

     

  8.  Use the Box Output tool to upload local files to Box. To do so, first authenticate to your Box instance and select the Upload File to Box option. Then, select the source path of the file you want to upload. In our example, we selected the FullFilePath field which we also used in the step 5.

    (Optional) You can also select a dynamic Target Path, by clicking on Set File Path by Field and selecting appropriate field. In our case, we selected a date field, so Box Output will create a new folder for each value in date field, and then upload our file in that folder.

    (Optional) In the Options tab, you can also select an Existing File Action. This allows you to Rename, Overwrite or Abort the upload of a file in case identically named file already exists in Box.
    AlteryxProducts_5-1646757205335.png

Additional Resources

No ratings