🗓️ Live Webinar August 17: How Allbirds solves identity resolution in the warehouse with dbt Labs, Snowflake, and RudderStack

Register Now
By Rudderstack Team

How to load data from Trello to SQL Data Warehouse

The purpose of this guide is to help you define a process or pipeline for getting your data from Trello and load it into SQL Data Warehouse for further analysis. Information will be given to access and extract your data from Trello through its API and how to load it into SQL Data Warehouse.

This process requires you to write the code to get the data and ensure that this process will run every time new data is generated. Alternatively, you can use products like Rudderstack that can handle this kind of problem automatically for you.

About Trello

Trello is a collaboration tool that organizes your projects into visual boards. In one glance, Trello tells you what’s being worked on, who’s working on what, and where something is in progress. Trello is simple but flexible enough to organize your boards using any methodology that you like. For example, many people use Trello to run Kanban.

Trello is simple on the surface, but cards have everything you need to get stuff done. You can post comments for instant feedback. Upload your files from Google Drive, Dropbox, Box, and OneDrive. Add checklists, labels, due dates, and more. Notifications make sure you always know when important stuff happens.

It offers a very simple pricing scheme:

  1. Free: this first tier might cover the majority of users. You have access to all the basic functionalities that Trello.
  2. Business Class & Enterprise: Charged per seat and per month. The main difference between the two is the number of teams that are supported. Also, app integration, team overview, increased file size allowed, file encryption, better support, restricted membership, and enterprise-grade security is provided compared to the Free.

As more and more teams rely on Trello to run and track their projects, valuable data can be pulled from it that can help you better understand your company’s productivity. For example, by pulling data out from Trello and storing it into Azure SQL, you can calculate numerous metrics about your sprint, like its current burndown rate. Identify projects with problems and figure out potential bottlenecks. This article will find out how we can pull data from Trello to Azure SQL Data Warehouse for further analysis.

About Microsoft Azure SQL Data Warehouse

SQL Data Warehouse is the data warehousing solution you can use if you are a user of Microsoft Azure. It’s an elastic data warehousing as a service solution, emphasizing its enterprise focus. It also speaks SQL like the previous two solutions, and it supports querying both relational and non-relational data. It offers a number of enterprise-class features like support for hybrid cloud installations and strong security. It’s probably the less mature solution than the two others though, it’s still in Preview mode, although accessible to existing Azure subscribers.

Extract your data from Trello

Trello exposes a very rich API to developers. It is the same API used internally to build the web and mobile Trello apps that we all use and love. It is possible to build a completely new application on top of the API using the different components and resources it exposes or just use it to pull out data as we plan to do.

The Trello API follows RESTful principles, and it can be accessed through HTTP. As a RESTful API, interacting with it can be achieved using tools like CURL or Postman or using HTTP clients for your favorite language or framework. A few suggestions:

Trello also offers an official Javascript client/wrapper for its API, which can be found here. It is also possible to find numerous other unofficial SDKs. All it takes is a quick search on Google or Github.

Trello API Authentication

The Trello API supports authentication and Authorization by implementing the OAuth protocol. It’s important to understand that the Authentication Token, obtained through the OAuth workflow execution, gives your application the ability to make calls on behalf of your user from their context. This token grants access to the authenticated user’s boards, lists, cards, and other settings, depending on the permissions you requested in the authenticate method. So you have to handle it with care.

Trello rate limiting

To help prevent strain on Trello’s servers, our API imposes rate limits per API key for all issued tokens. There is a limit of 300 requests per 10 seconds for each API key and no more than 100 requests per 10-second interval for each token. If a request exceeds the limit, Trello will return a 429 error.

Endpoints and Available Resources

The Trello API exposes a large number of resources together with their associated HTTP endpoints that allow the users to interact with the platform as the web and mobile applications of Trello do. The most important resources are the following:

  • Board: anything related to the boards a user can create and manage in Trello
  • Card: operations about the cards that can be created inside boards
  • Checklist: it allows the creation and manipulation of checklists inside cards
  • Label: operations related to labels that can be created inside cards
  • List: operations on lists
  • Member: operations related to members of a board
  • Notification: operations about the notification system of the platform
  • Organization: manage organizations inside Trello

So, let’s assume that you have a board that helps you track one of your projects. The methodology doesn’t matter at this point. What is important is that you most probably will have cards associated with tasks, and these cards are holding the information that you would like to pull, store in a database like Azure SQL and analyze it further. First, we assume that we know the ID of our board,

  • our board id is 4eea4ffc91e31d1746000046

First, we want to get all the lists that this board includes. To do that, we execute a GET request on the following URL:

https://api.trello.com/1/boards/4eea4ffc91e31d1746000046/lists?cards=open&card_fields=name&fields=name&key=[application_key]&token=[optional_auth_token]

If the request is successful, we will get back a response like the following:

[{
"id": "4eea4ffc91e31d174600004a",
"name": "To Do Soon",
"cards": [{
"id": "4eea503791e31d1746000080",
"name": "Finish my awesome application"
}]
}, {
"id": "4eea4ffc91e31d174600004b",
"name": "Doing",
"cards": [{
"id": "4eea503d91e31d174600008f",
"name": "Learn about the Trello API"
}, {
"id": "4eea522c91e31d174600027e",
"name": "Figure out how to read a user's board list"
}]
}, {
"id": "4eea4ffc91e31d174600004c",
"name": "Done",
"cards": [{
"id": "4eea501f91e31d1746000062",
"name": "Get a key to use in my API requests"
}, {
"id": "4eea502b91e31d1746000071",
"name": "Find out where the Trello API documentation is"
}]
}]

The above JSON response includes all the lists that our product has. Each least will contain cards with tasks, and for example, if we have a card inside the Done list, it means that the associated task is completed.
After we got a list of all the lists, we can start fetching each list’s cards. Again we do that by executing a GET request to the appropriate endpoint, using the IDs of the lists that we have extracted from the previous response. A typical URL for fetching the cards of a list looks like the following:

https://api.trello.com/1/lists/4eea4ffc91e31d174600004a/cards?key=[application_key]&token=[optional_auth_token]

And the result of a successful request to the above endpoint will result in something with the following structure:

[{
"id": "4eea503791e31d1746000080",
"badges": {
"votes": 0,
"viewingMemberVoted": false,
"subscribed": false,
"fogbugz": "",
"checkItems": 0,
"checkItemsChecked": 0,
"comments": 0,
"attachments": 0,
"description": false,
"due": null
},
"checkItemStates": [],
"closed": false,
"dateLastActivity": "2011-12-15T19:53:27.228Z",
"desc": "",
"descData": null,
"due": null,
"email": null,
"idAttachmentCover": null,
"idBoard": "4eea4ffc91e31d1746000046",
"idChecklists": [],
"idLabels": [],
"idList": "4eea4ffc91e31d174600004a",
"idMembers": [],
"idMembersVoted": [],
"idShort": 3,
"labels": [],
"manualCoverAttachment": false,
"name": "Finish my awesome application",
"pos": 65536,
"shortLink": "XlG8S7ll",
"shortUrl": "https://trello.com/c/XlG8S7ll",
"subscribed": null,
"url": "https://trello.com/c/XlG8S7ll/3-finish-my-awesome-application"
}]

We have retrieved all the relevant to our project information from our board. We just need to remodel our data in an appropriate way to query it on a database like Azure SQL and, of course, ensure that we properly load the data to it. After we do that, we are ready to start querying our Trello data and learning everything related to the performance of our teams and projects.

Load Data from Trello to SQL Data Warehouse

SQL Data Warehouse support numerous options for loading data, such as:

  • PolyBase
  • Azure Data Factory
  • BCP command-line utility
  • SQL Server integration services

As we are interested in loading data from online services by using their exposed HTTP APIs, we will not consider the usage of BCP command-line utility or SQL server integration in this guide. We’ll consider the case of loading our data as Azure storage Blobs and then use PolyBase to load the data into SQL Data Warehouse.

Accessing these services happens through HTTP APIs. As we see again, APIs play an important role in both the extraction and the loading of data into our data warehouse. You can access these APIs by using a tool like CURL or Postman. Or use the libraries provided by Microsoft for your favorite language. Before you upload any data, you have to create a container similar to a concept to the Amazon AWS Bucket. Creating a container is a straightforward operation, and you can do it by following the instructions found on the Blog storage documentation from Microsoft. As an example, the following code can create a container in Node.js.

blobSvc.createContainerIfNotExists('mycontainer', function(error, result, response){
if(!error){
// Container exists and allows
// anonymous read access to blob
// content and metadata within this container
}
});

After the creation of the container you can start uploading data to it by using again the given SDK of your choice in a similar fashion:

blobSvc.createBlockBlobFromLocalFile('mycontainer', 'myblob', 'test.txt', function(error, result, response){
if(!error){
// file uploaded
}
});

When you are done putting your data into Azure Blobs, you can load it into SQL Data Warehouse using PolyBase. To do that, you should follow the directions in the Load with PolyBase documentation. In summary, the required steps to do it are the following:

  • create a database master key
  • create a database scoped credentials
  • create an external file format
  • create an external data source

PolyBase’s ability to transparently parallelize loads from Azure Blob Storage will make it the fastest loading data tool. After configuring PolyBase, you can load data directly into your SQL Data Warehouse by simply creating an external table that points to your data in storage and then mapping it to a new table within SQL Data Warehouse.

Of course, you will need to establish a recurrent process that will extract any newly created data from your service, load them in the form of Azure Blobs and initiate the PolyBase process for importing the data again into SQL Data Warehouse. One way of doing this is by using the Azure Data Factory service. In case you would like to follow this path, you can read some good documentation on how to move data to and from Azure SQL Warehouse using Azure Data Factory.

The best way to load data from Trello to SQL Data Warehouse and possible alternatives

So far, we just scraped the surface of what can be done with Microsoft Azure SQL Data Warehouse and how to load data into it. The way to proceed relies heavily on the data you want to load, from which service they are coming from, and the requirements of your use case. Things can get even more complicated if you want to integrate data coming from different sources.

Instead of writing, hosting, and maintaining a flexible data infrastructure, a possible alternative is to use a product like RudderStack to handle this kind of problem automatically.

Rudderstack integrates with multiple sources or services like databases, CRM, email campaigns, analytics, and more.

Get Started Image

Get started today

Start building smarter customer data pipelines today with RudderStack. Our solutions engineering team is here to help.

Customer Data Platform for Developers | RudderStack
HIPPA Compliant
SOC 2 TYPE 2