This article provides steps on how to upload locally saved files of any typeto Box.
220.127.116.11061 and later.
2.2.0 and later.
UseCase 1 – Upload 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.
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.
In the Directory tool, select the folder you want to upload files from.
(Optional)If you want to use the Filter tool, connect it after the Directory tool, and select how to filter the files.
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.
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.
UseCase 2 – Create 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.
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.
Set up your workflow to output the data you want. In this example, we’re using a simple Text Input for placeholder data.
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.
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.
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.
(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.
Use the Unique tool to remove any duplicates in the path so that each file is uploaded only once.
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.