How to query your Xero Payroll UK data from Looker Studio

For many, the built-in Xero Payroll UK reports on offer are enough for our day-to-day needs. However, if you need something a little more customized, then you’re going to have to have to build it yourself. And what better way than using the tool you’re already familiar with - Looker Studio

Ben Liebert Developer & Data Specialist LinkedIn

Xero Payroll UK is a sophisticated and comprehensive cloud-based platform. For many, the built-in reports and analysis that Xero Payroll UK offers is enough for our day-to-day needs. However, if you need something a little more customized, you need to aggregate your data over multiple Xero Payroll UK accounts, or you need to cross-reference your Xero Payroll UK data with other cloud services, then you’re going to have to build it yourself. And what better way than using the tool you’re already familiar with - Looker Studio (formerly Google Data Studio).

In this article, I’ll take you through the steps to connect Looker to your Xero Payroll UK data, and get started customizing the reports you need.

First - grab your SyncHub Credentials

If you don’t already have a SyncHub account, you can grab a free trial here - go on, I’ll wait - it only takes a minute and you can cancel as soon as you’ve finished this tutorial if you like.

Ready? Now, a quick reminder - SyncHub works by staging your Xero Payroll UK data in a relational database. This gives us a huge advantage over other connectors which query the Xero Payroll UK API directly, but I won’t go in to them here. The point is, once you have connected your Xero Payroll UK account, querying from Looker is trivial as you are just using its native SQL Server Connector.

So, once you’re connected, go to your SyncHub Dashboard and grab your new database credentials, then proceed back to this article

Reading your Xero Payroll UK data from Looker Studio

We now just need to tell Looker where to find your data, and for this we use the built-in SQL Server connector - easy! Hit the Add Data button, then search for “SQL Server”:

Connection

Now, plug in the credentials which you downloaded from SyncHub earlier:

Credentials

Once authenticated, you can write a custom query to extract just the view you need. For example, this SQL grabs the top few records from your Employee table:


select [Title], [FirstName], [LastName], [Email], [StartDate]
from schema_xeropayrolluk_1.Employee

Custom query

Keeping your data up-to-date

SyncHub updates it’s staged data from Xero Payroll UK in near-realtime, so it’s always available. However, Looker offers it’s own cache which may have a different refresh setting. To adjust the freshness of your data, remember to Edit your connection and then the Data Freshness value:

Cache

Beyond Xero Payroll UK

Xero Payroll UK-specific reports are essential, but the true power of SyncHub comes when you augment your Xero Payroll UK data with additional information:

So what are you waiting for? Grab a free trial of SyncHub here and see what you can do. In ten minutes from now, you could be reporting against your Xero Payroll UK data and taking your first steps towards a data-driven business.