Organize your matters and documents with Hivelight, Zapier, and OneDrive
NOTES:
In this tutorial we are using OneDrive as most people have access to it. But this can also be done with the folders on a matter in your practice management system.
Here is a link to the Zapier automation template we've used. Just copy and adapt it to your needs.
If you are in legal practice, chances are you probably have a Microsoft 365 Business subscription - i.e. access to MS Word, MS Excel, OneDrive, SharePoint etc etc.
Chances are you also need to solve:
Having a way to manage where all your matters are up to (solved with Hivelight), and
Having a place to store documents for your matters and keep them organized.
Many firms and in-house teams use OneDrive and SharePoint to store and share documents securely.
So, we've created this tutorial to help you tie it all together, enabling automatic creation of matter folders (and consistent folder structures) in OneDrive when a new matter is created in Hivelight - with direct links to the matter folder from Hivelight.
This is surprisingly easy to do, but will no doubt impress your coworkers when you set it up.
In this tutorial we'll show you how to set up the following automation:
User creates a new matter in Hivelight,
Automatically create a corresponding matter folder in OneDrive with a specified folder structure,
Automatically add an initial workflow to the new Hivelight matter,
Automatically populate the tasks in the new workflow with links to the new matter folder in OneDrive
Add the OneDrive link to the 'Resources' (see 'Show more' in the matter header/banner) dropdown in your matters.
You'll be able to set this up with Zapier or Power Automate. We've used Zapier in this tutorial as it is easier for most non-technical people to use.
Step 1: Create a new Zap (automation) in Zapier
Open Zapier and start a new Zap.
Select the Webhook module and choose the 'Catch Hook' event. Now go to 'Test' and copy the webhook URL it gives you.
Step 2: Set up a webhook in Hivelight to tell Zapier when a new matter is created
Next you'll need to set up a webhook in Hivelight (Webhooks tell another application that you specify about certain events - in this case, we'll set up a Webhook in Hivelight that tells Zapier whenever a new task is created in Hivelight) and give it the zapier webhook url so it can tell Zapier when a new matter has been created.
Go to Settings > Integrations > Webhooks
Under 'Select event' choose 'matter.created'.
Delete the content under 'Secret'.
Under 'Webhook URL' paste the webhook URL you got from Zapier and click on 'Test'. Then click on 'Create webhook'.
Step 3: Create a new matter in Hivelight
Create a new matter in Hivelight to fire a new webhook event for Zapier to catch. You'll use this to build and test the automation in Zapier.
Click on the Webhooks step in Zapier and continue through to 'Test'.
Click on 'Find new records' and select the 'request' with the data for the new matter you just created in Hivelight. Then test the step and 'continue with selected record'.
Step 4: Add the steps to create the matter folders in OneDrive
In Zapier, add a OneDrive connector.
Set 'Action event' to 'Create Folder'.
Under 'Account' connect your OneDrive account (note: this automation requires that you use your work account).
Proceed to the 'Configure' stage.
Under 'Folder' select the parent folder in which you create all your matter folders. In our example we have a parent folder called 'Matters' where we create all the folders for our matters.
Set 'Name' to the '1. Data Attributes Name' value that is provided by Hivelight via the webhook. This will cause the matter folder to be created with the same name as the matter in Hivelight.
Step 5: Add the steps to create the subfolders (folder structure) for each matter folder
Now consider what you want the standard subfolders to be for each matter (and yes, the webhook from Hivelight provides the matter type so you can have different folder structures depending on the matter type if you want to).
In our example we use the following folder structure within each matter folder:
Desktop view
Browser view
To do this we just create a sequence of additional OneDrive connectors that are set to Create Folder (under 'Action event'), but importantly under the 'Folder' field we click on the 3 dots and select 'Custom'.
Then select 'Create Folder inn OneDrive' and select 'Folder Path'. This will cause the current folder to be created inside the matter folder that was created in the previous step.
Then choose a name for the new subfolder - in the example below we use the name 'Client Documents'.
Simply repeat this step to keep adding more standard subfolders. You can save time by clicking on the 3 dots to the top right of the third step in this automation and selecting 'Duplicate' and then just change the name of the folder you want it to create.
Bonus - cause a roadmap to be automatically applied to new matters that contains a link to the new matter folder in OneDrive.
After the previous step you can just publish the Zapier automation and start creating new matters in Hivelight. The automation will cause new matter folders to be created for each new Hivelight matter in OneDrive.
However, we can do even better.
Select one of the new matter folders you have created, and view it online (right click and there'll be an option for 'view online').
Right click on the folder in the browser and 'Copy Link' and then paste the link (use Ctrl+Shift+V to paste as plain text) into a text editor or document. The link will have a structure like the following:
https://[Organisaiton Name]-my.sharepoint.com/:x:/r/[Account Name]/Documents/[Folder Name]
For example:
Note: any thing after the 'Account Name' portion (which will look like your work email address) can be replaced with /Documents/[Folder Name]
Because the link is predictable, and the folder name will be the same as the matter name, we can create a dynamic link for this in a Hivelight workflow and automatically apply that workflow to these new matters.
So, let's do it!
Create the dynamic folder link using the variables feature in Hivelight (i.e. {{matter.name}}) to add the matter name. this will look something like:
https://hivelighthq-my.sharepoint.com/:f:/g/personal/ashleykelso_hivelighthq_onmicrosoft_com/documents/{{matter.name}}
Now create a roadmap in Hivelight. Create a task in the roadmap. Add the text "π Matter Folder (OneDrive)" - or similar - to the task and select the text. The 'Link' option will appear. Paste the link with the matter name variable and hit 'Enter'.
Publish the workflow and copy the workflow id (see screenshot below).
Go to Zapier and add a Webhooks action to your automation.
Set 'Action event' to 'POST'.
Set 'URL' to: https://api.hivelight.com/v1/matters/[Matter ID]/apply/[Workflow ID]
The '[Matter ID]' portion will be '1. Data Id' which is obtained from the webhook (click on the '+' button and find it in the list.
The '[Workflow ID]' will be the workflow ID that we just obtained above.
Set 'Payload Type' to 'Json'.
Set the Headers to
x-api-key [Your API Key]
Content-Type application/json
Now test and publish your Zapier automation.
Tip: Copy and paste the Matter Folder link into the 'Resources' drop down for quick access to the matter folder.