Operations with Box Objects
You can use a Box connection to perform the following operations with Box objects:
- Box Sources
- - Read data from CSV files in Box.
- - Search objects in Box.
- Box Targets
- - Delete files and folders in Box.
- - Download objects from Box.
- - Upload objects to Box.
- - Write data to CSV files in Box.
Delete Box Objects
You can specify Box targets in Data Synchronization tasks, mappings, and Mapping Configuration tasks to delete Box objects.
You can delete Box files or folders based on the ID or path that you specify in a file that you must name delete.csv. When you specify a file ID or path, the Secure Agent deletes the file. When you specify a folder ID or path, the Secure Agent deletes all the objects in the folder.
The following image shows the contents of the delete.csv file:
To delete objects from Box, perform the following tasks:
- 1. Create a delete.csv file with the File_or_Folder_ID and File_or_Folder_Path fields and values.
- 2. Save the delete.csv file to a local directory on the machine that hosts the Secure Agent.
- 3. Create a flat file connection to the location of the delete.csv file.
- 4. In the Data Synchronization task or mapping you want to create to delete Box objects, configure the following objects:
- a. Specify the flat file connection as the source connection and select delete.csv as the source object.
- b. Specify a Box connection as the target connection and select delete as the target object.
- c. Select Delete as the target task operation.
- d. Map the File_or_Folder_ID or File_or_Folder_Path fields in the source object with the File_or_Folder_ID or File_or_Folder_Path fields in the target object.
Download Box Objects
You can specify Box targets in Data Synchronization tasks, mappings, and Mapping Configuration tasks to download Box objects.
You can download Box files or folders based on the ID that you specify in a file that you must namedownload.csv. When you specify a file ID, the Secure Agent downloads the specified file. When you specify a folder ID, the Secure Agent downloads all the objects in the folder.
The following image shows the contents of the download.csv file:
By default, the Secure Agent downloads all the Box objects to the root directory in the Secure Agent machine. However, to download the files to a specific directory, you can specify a path in the Target File Path field when you create the Box connection. Verify that you specify a directory that is local to the machine that hosts the Secure Agent.
To download objects from Box, you need to perform the following tasks:
- 1. Create a download.csv file with the File_or_Folder_ID field and values.
- 2. Save the download.csv file to a local directory on the machine that hosts the Secure Agent.
- 3. Create a flat file connection to the location of the download.csv file.
- 4. In the Data Synchronization task or mapping you want to create to download Box objects, perform the following tasks:
- a. Specify the flat file connection as the source connection and download.csv as the source object.
- b. Specify a Box connection as the target connection and select download as the target object.
- c. Select Insert as the target task operation.
- d. Map the File_or_Folder_ID field in the source object with the File_or_Folder_ID field in the target object.
Upload Box Objects
You can specify Box targets in Data Synchronization tasks, mappings, and Mapping Configuration tasks to upload Box objects.
You can upload Box files or folders based on the path that you specify in a file that you must name upload.csv. When you specify a file name, the Secure Agent uploads the file to Box. When you specify a folder path, the Secure Agent uploads all the objects in the folder to Box.
The following image shows the contents of the upload.csv file:
By default, the Secure Agent uploads the files to the root directory on the Secure Agent machine. To upload the files to a specific directory, you can specify the folder ID in the Box File or Folder ID field when you create the Box connection. If you specify a file ID in the Box connection, the Secure Agent inserts the uploaded data in to the specified file.
To upload objects to Box, you need to perform the following tasks:
- 1. Create a upload.csv file with the File_or_Folder_Path field and values.
- 2. Save the upload.csv file to a local directory on the machine that hosts the Secure Agent.
- 3. Create a flat file connection to the location of the upload.csv file.
- 4. In the Data Synchronization task or mapping you want to create to upload Box objects, configure the following objects:
- a. Specify the flat file connection as the source connection and select upload.csv as the source object.
- b. Specify a Box connection as the target connection and select upload as the target object.
- c. Select Insert as the target task operation.
- d. Map the File_or_Folder_Path field in the source object with the File_or_Folder_Path field in the target object.
Write Data to CSV Files in Box
You can specify Box targets in Data Synchronization tasks, mappings, and Mapping Configuration tasks to write data to CSV files in Box.
To configure Data Synchronization tasks or mappings to write data to CSV files in Box, perform the following tasks:
- 1. Configure a source transformation to the object from which you want to read data.
You can read data from any source and write data to CSV files in Box. However, when you read from a flat file object, you can write data only to an existing CSV file.
- 2. Specify a Box connection that connects to the Hosted Agent or the Secure Agent as the target connection and specify the target object.
Note: You can override the file or folder ID you specify in a Box connection with the value you specify in the Box Target File ID advanced target property in Data Synchronization tasks or mappings.
- 3. Select Insert as the target task operation.
Read Data from CSV Files in Box
You can specify Box sources in Data Synchronization tasks, mappings, and Mapping Configuration tasks to read data from CSV files in Box.
To configure the Data Synchronization tasks or mappings to read from CSV files in Box, perform the following tasks:
- 1. Specify a Box connection that connects to the Hosted Agent or the Secure Agent as the source connection and specify the source object.
- 2. Configure a target transformation to the object to which you want to write the Box data.
Search Box Objects
You can specify Box sources in Data Synchronization tasks, mappings, and Mapping Configuration tasks to search Box objects.
To search objects to Box, perform the following tasks:
- 1. Specify the search criteria in the URI Request Parameters field when you create the Box connection.
- 2. To configure the Data Synchronization task or mapping to search Box objects, perform the following tasks:
- a. Specify a Box connection as the source connection and enter Entities as the source object.
- b. Select Insert as the target task operation.
- c. Specify a target transformation to write the search results.
When you specify Entities as the source object, the Secure Agent searches all objects in the root folder on the Secure Agent machine based on the URI request parameters you specify in the Box connections.
Specify the search string in the URI Request Parameters field using the following syntax:
query=search_string;content_types=<name|description|file_content|comments|tags;limit=<number>;offset=<number>
The following table describes the URI Request Parameters field options:
Options | Description |
---|
Query | Searches the Box objects based on the word or phrase you specify. When you specify a phrase, verify that you enclose the phrase in single quote. |
content_types | Specifies the scope of the search. You can use one of the following values: - - Name - Searches based names of Box objects.
- - Description - Searches based on the description associated with Box objects.
- - File_content - Searches based on contents in the Box objects.
- - Comments - Searches based on comments associated with Box objects.
- - Tags - Searches based on tags associated with Box objects.
|
limit | Limits the number of search results that the Secure Agent writes to the target. |
offset | Offsets the search results based on the specified offset value. For example, if you specify the offset value as 12, the Secure Agent ignores the first 11 rows in the search results and writes the results from the 12th row. |
The following image shows the Box connection properties with the URI request parameters: