In this article we will explain an automated process associated with Box.

Box is a cloud storage service provided by Box Inc. You can use it for personal use, or you can create shared folders for multiple people to use. You can also use its API to perform various operations, and the automated Tasks we’ll discuss here are based on its API.

For more information about Box, please refer to the official Box Support page.

About each automated Task

Automatic Tasks related to Box include Upload File, Copy File, Create Folder, Search Folder, Create Shared Link to Folder, and Delete Folder. In this page, we will focus on four of them: Create Folder, Upload File, Create Shared Link to Folder and Delete Folder.

First, we’ll briefly explain each Task.

Box: Create Folder

Create Folder Task settings screen

Specify a folder on Box and create a new folder in it. You can save the created folder’s ID and URL in Data Items.

Box: Upload File

Upload File Task settings screen

Upload a file to Box. You can specify the files to be uploaded in a File-type Data Item. By setting multiple files in a File-type Data Item you can simultaneously upload multiple files. You can specify the destination of the uploaded files with a Folder ID. If you don’t, the files are uploaded to the root folder of the User who uploads them. You can also save the URL of the uploaded file in a Data Item.

Box: Create Shared Link to Folder

Create Shared Link to Folder settings screen

Specify the folder you want to share on Box and generate a shared link. You can add Data Items to set an expiration date and password.

Box: Delete Folder

Delete Folder Task settings screen

Specify files and folders on Box to be deleted. You can delete multiple files or folders at once by using a String-Type (multiple lines) Data Item, in which case you should write one ID per line.

To use these automatic Tasks, it is necessary to obtain a token linked to the Box account from the OAuth2 Settings button in the Service Task. Follow the steps below to set it up.

How to Integrate Box with Questetra

In the Box Tasks select the OAuth2 Settings button under C1: OAuth2 Settings Name.

Next, click the Add button and enter a suitable name in the “Name” field. It is recommended that you use something like “Connect with {account name of Box}” so that you can easily identify the account to which it is connected.

If you click the Get Token button the login screen to your Box account will be displayed (but if you have already logged in to Box via the browser you are using, only the “Grant access to Box” screen will be displayed).

Enter your Box account (email address) and password, log in, and click “Grant access to Box”.

If the authentication is successful we will return to the OAuth2 configuration page in Questetra and “o (Refresh token)” will be displayed in the “Have a Token?” field.

Sample App

Sample App created using automated processes

This app is for sending files to people outside the company. The method is to upload a file to a dedicated folder created in Box and share the folder. The URL of the folder is set to be shared with people outside the company by email. Also, the folder and the files in it are set to be deleted a day after it is created. This method is used for files which are too large to be sent by email or when there are multiple files in a folder.

Data ItemTypeRequiredFile Attachment TaskConfirmation of shared link TaskDescription
TitleEditableDisplay onlyThe Title of the Process.
ID of the shared folderString-type (single line)No displayNo displaySave the folder ID created in the Create Folder Task.
Shared Link URLString-type (single line)No displayDisplay onlySave the shared URL of the folder created in the Create Shared Link to Folder Task.
Upload fileFile-typeYesEditableDisplay onlySave the file to be uploaded and shared.
Data Item settings

First, specify the file to be shared in the “File Attachment” Task. In the following “Create Folder” Task (see Box: Create Folder) create a folder to be shared on Box.

Item nameRequiredDescription
C1: OAuth2 Setting Name*YesTo specify OAuth2 settings to connect to Box. In the OAuth2 settings, you need to get a token beforehand (see “How to Integrate Box with Questetra”).
C2: Parent Folder IDTo specify in which folder you want to create the new folder using the ID. Let’s leave it blank this time and specify the root folder.
C3: Folder Name to create*YesTo specify the name of the folder to be created:let’s use “#{processInstanceId}” this time. The “#{processInstanceId}” part will contain the process ID, so that there will be no duplication with other folders created by this App.
C4: String type data Item that will save Folder IDTo specify the Data Item for saving the generated folder ID: this time, specify the ID of the created folder.
C5: String type data Item that will save Folder IDTo specify the Data Item for saving the URL of the generated file. Not specified this time.
Box: Create Folder settings

Next, upload the specified file to the created folder.

Item nameRequiredDescription
C1: OAuth2 Setting Name*YesTo specify OAuth2 settings to connect to Box. In the OAuth2 settings you need to get a token beforehand (see “How to Integrate Box with Questetra”).
C2: File type data item whose attached files will be uploaded*YesTo specify the Data Item that contains the file to be uploaded: specify “Upload File” this time.
C3: Folder ID that files will be uploaded (Root folder if blank)To specify the ID of the folder to save the uploaded file: this time, specify “#{#q_folder_id}” which is the Field Name of the “Upload File” data item.
C4: String type data item that will save uploaded file idsTo specify the Data Item for saving the ID of the uploaded file. It is not used this time.
C5: String type data item that will save uploaded file urlsTo specify the Data Item for saving the URL of the uploaded file. It is not used this time.
Box: Upload File settings

When you have completed the settings, proceed to the Create Shared Link to Folder Task, where you can create a shared link from the ID of the created folder.

Item nameRequiredDescription
C1: OAuth2 Setting  Name*YesTo specify OAuth2 settings to connect to Box. In the OAuth2 settings, you need to get a token beforehand (see “How to Integrate Box with Questetra”).
C2: Folder ID to share*YesTo specify the ID of the folder to be shared. Select “ID of the shared folder” from “Insert reference…”.
C3: Date Time type data Item with Expiration of the LinkTo specify  the expiration date of the shared link in a Datetime-type Data Item: it is not used this time.
C4: String type data Item with Password of the LinkSpecifies the password for the shared link in a String-type Data Item. Not used in this case.
C5: String type data Item that will save web the Shared Link*To specify a Data Item for saving the generated shared link: this time, specify “Shared Link URL”.
Box: Create Shared Link to Folder settings

After completing the settings proceed to the Shared Link Confirmation Task. In this Task check the URL in the Shared Link URL and tell the person you are sharing it with about the URL. Since there are no informing functions included in the app please do it by email or add an automatic sending Task.

Once confirmed, proceed to the Timer Intermediate Event.

Item nameDescription
Datetime specified by Data ItemTo specify the date and time to proceed to the next Data Item. It’s not used this time.
Datetime specified by an expressionTo specify the date and time to proceed with an expression. This time the expression “presenceInstanceStartDatetime.addDays(1)” is used.
Timer Intermediate Event settings

This will allow you to wait until one day after you start the process. The receiving party should receive the file during this time.
※ Related Manual: M223: Automatically Sleep for a Specified Period During A Process

After one day, the folder will be deleted in the Delete Folder Task (see Box: Delete Folder).

Item nameRequiredDescription
C1: OAuth2 Setting Name*YesTo specify OAuth2 settings to connect to Box. In the OAuth2 settings you need to get a token beforehand (see “How to Integrate Box with Questetra”).
C2: Data Item with folder IDs to delete*YesTo specify the Data Item containing the ID of the folder to be deleted: this time, specify the ID of the folder to be shared.
Box: Delete Folder settings

Once the folder is deleted the entire process is complete.

That’s all for today.

%d bloggers like this: