Previously in our blog, we described how to Streamline File Collection by using the file request endpoints in our API, however you don’t have to write a full integration to take advantage of the API! Dropbox recently announced a partnership with Tray.io, a flexible General Automation Platform that lets users integrate and automate their business processes. As a developer, building automation workflows on the Tray Platform can save hours of manual work or custom app development.
Let’s say it’s 9:05 AM on Tuesday, and you just realized that yet again, you have to collect reports from your team. Since you do this twice a week, you’re quite familiar with the process. You open up Dropbox to create a File Request so that every report can be submitted and stored in a single location. This is easy enough from the Dropbox interface, but doing the same task every Monday is getting repetitive. Following the same series of clicks you do every week, you create the request. As you continue sipping your morning coffee, you begin to plan tomorrow’s tedious task of sorting through the pile of file request submissions. You think to yourself, there must be a better way to collect and organize these files every week. Yes, there is.
In order to automate this process, you first need to determine your specific needs. Let’s assume your process is relatively straightforward, and you have this basic set of requirements:
Each week on Tuesday and Thursday morning, you want to send your team a File Request. They tend to be busy so you’d like to send a reminder email on both days.
Although the requirements are straightforward, they still pose interesting (and not always trivial) problems to be solved by a developer, namely:
- A scheduled trigger must execute code twice a day for two days of the week.
- The file request naming conventions are often unique and change constantly. We want to organize them in a way that will be useful in the future.
- An up-to-date list of team members needs to be maintained to send the recurring file requests and reminders.
These problems can be solved individually with the file request API, but tying them all together in a seamless workflow is where it can get challenging. With the Tray Platform, however, this becomes two concise workflows with a couple of pre-built connectors. To get a head start, let’s use the pre-built workflows* Tray.io has created on your behalf.
*Please contact the author for help accessing the pre-built workflows. You must have a Tray account.
In our example, the first workflow is named “Create/Send File Request” and the second workflow is named “Send Reminder Email.”
Workflow: Create/Send File Request
In the first workflow, we start with a Scheduled Trigger. The Tray Platform has many different types of trigger operations available. In this case, the Scheduled Trigger allows us to configure the workflow to our requirement using the ‘Every Day’ operation at 9:00 AM on Tuesday and Thursday.
The next operation in the workflow is a mustache template (learn more about Mustache Templates in the Tray docs) named Format Folder Title. It is responsible for creating a custom folder title for that day’s respective request. This operation adds clarity to the overall workflow and allows users to quickly edit the format of this folder title at a later time. New parameters can be added to the mustache template by following these steps:
- Click the ‘Add Property to Parameters” button
- Give your property a name
- Inside the Template Code input, use a mustache reference {{property_name}} anywhere you need to access your new variable
In the next connector, Create File Request Folder, we’re creating a new folder on Dropbox titled ‘Weekly File Request – {{month}}/{{day}}/{{year}}’ where the month, day, and year values come from the scheduled trigger. The date and folder path are used as parameters for the Create File Request connector, which uses the Dropbox API to create a hyperlink for our file request.
A second mustache template, Email Body Template, allows us to define what our co-workers receive in the body of their email so we can include the file request link. The final step, Distribute File Request is where you can build your list of co-workers that you need to send out emails to. In addition to the list of recipients, the Send Email connector also allows you to configure the email address that the request link is sent from, which is where replies to the email will go. After configuring these email addresses, the workflow is complete!
Workflow: Send Reminder Email
First, we edit the Scheduled Trigger start time to be 1600 hours (or 4:00 PM). The Format Subject mustache template is used to set the subject line, “Reminder to Submit File Request for {{day}}/{{month}}/{{year}}”. Finally, the Send Email connector uses the same recipient list and sender address from our first workflow, but we hardcode the email body as a reminder to respond to that day’s file requests.
Automate Your Workflows with Tray.io
With just two concise workflows in Tray.io, we’ve created a basic reporting system that automatically sends Dropbox file requests and reminder emails to our team each week. By abstracting some of the low level complexities away from the user, we’ve given them back some valuable bandwidth to focus on other challenges. Furthermore, because Tray.io is a low-code solution, building automated processes like the one in our example is accessible to users with lower levels of technical expertise. Learn more about how you can automate with Tray.io by joining their technical weekly demo.
Whether you’re working directly with the Dropbox file request API to streamline file collection like we outlined in a previous blog post or working with a Dropbox Technology Partner like Tray.io as described above, Dropbox file requests help you automate repeat tasks of collecting and organizing files from anyone, right in your Dropbox account.
If you need help with anything else, you can always contact the Dropbox team via our web form, developer forums, or on twitter.
Build with Dropbox today at
www.dropbox.com/developers