Artisan IMG > Dropbox (dropbox) (dc566de5-06fa-47ae-8ab0-a1c30e7ecce3)

Dropbox
5.4

Dropbox is a modern workspace designed to reduce busywork, stay connected with your team, and securely access all your files in one central place

Overview
Copy

Dropbox is a file hosting service which offers cloud storage, file synchronization, personal cloud, and local client software. It is a powerful set of tools for storing and sharing your work and collaborating on projects.

Authentication
Copy

When using the Dropbox connector, the first thing you will have to do is click on 'New Authentication' in the step editor:

You can then enter your Dropbox credentials to link to your account:

Available Operations
Copy

The examples below show one or two of the available connector operations in use.

Please see the Full Operations Reference at the end of this page for details on all available operations for this connector.

Note on Operations usage
Copy

When referencing file paths in Dropbox, you must use the 'absolute' path - i.e. it must begin with a / - for example '/test-folder' or '/images/photo.png'

Example Usage - creating a new marketing project
Copy

TRAY POTENTIAL: Tray.io is extremely flexible. By design there is no fixed way of working with it - you can pull whatever data you need from other services and work with it using our core and helper connectors. This demo which follows shows only one possible way of working with Tray.io and the Dropbox connector. Once you've finished working through this example please see our Introduction to working with data and jsonpaths page and Data Guide for more details.

This short example tutorial will demonstrate the Create Folder and Copy file/folder operations, and show how Dropbox can be used in conjunction with other services.

It imagines a scenario whereby the first step in creating a new marketing project is initiated by creating a new Slack channel for this project. This kicks off a sequence of events:

  1. A new project channel is created by someone in Slack

  2. A new project board is auto-created in Trello (could be another project management tool, such as Asana)

  3. A new project folder is auto-created in Dropbox

  4. A renamed presentation template is automatically copied into the new project folder

The completed workflow looks like this:

The steps involved are:

1 - Setup the Slack trigger
Copy

When creating the workflow choose Slack as the trigger and create a Slack Authentication.

Then set the Operation to On Slack Event and the Event as Channel created:

The workflow will then be triggered when you create a new channel:

2 - Create Trello project
Copy

Create a Trello authentication. Set the Operation to Create new board:

You can pick up the name for the project board from the name given to the Slack channel using the $.steps.trigger.event.channel.name jsonpath.

JSONPATHS: For more information on what jsonpaths are and how to use jsonpaths with Tray, please see our pages on Basic data concepts and Mapping data between steps

When the workflow is triggered, you will see the new project board appear in Trello:

3 - Create a new Dropbox folder
Copy

Create a Dropbox authentication as explained above.

Set the Operation as Create folder:

As with the Trello board, you can pick up the name for the project folder from the name given to the Slack channel using the $.steps.trigger.event.channel.name jsonpath (feel free to use the connector-snake to autocomplete this for you).

CONNECTOR-SNAKE: The simplest and easiest way to generate your jsonpaths is to use our feature called the Connector-snake. Please see the main page for more details.

Note, however, that we are using a trick here to append the project folder name to a top-level 'marketing' folder in Dropbox. We are leaving the 'Path' box as a String type and 'interpolating' the jsonpath by enclosing it in { }.

INTERPOLATION: When you wish to include JSON generated data within another input/output result, use our Interpolation method as described here.

Thus the final folder path is /marketing/{$.steps.trigger.event.channel.name}

When the workflow is triggered, you will see the new project folder appear in Dropbox:

4 - Copy the presentation template
Copy

The second Dropbox step assumes that you have some templates available in a 'marketing/templates' folder, and copies a renamed presentation template from there into the newly created project folder.

Set the Operation as Copy file/folder:

When the workflow is triggered, you will see the new presentation template appear in the new Dropbox project folder:

Extra step - checking the new project is marketing
Copy

In the above example, it is likely that you will not wish for all new Slack channels to automatically create a Trello board and Dropbox folder.

In this case you can make use of our Text Helpers and Boolean Condition connectors to check if the new Slack channel contains 'marketing' in the name.

Your workflow will then look like this:

The text helper connector can use the Contains operation to check if the name of the Slack channel contains the word 'marketing':

It will return a true/false result which the boolean connector can then check for:

The actions on the True path will then only be activated if a channel which contains 'marketing' is created!

BEST PRACTICES: Whenever you do decide to create your own workflow, be sure to check out some of our key articles such as: