Skip to content
  • There are no suggestions because the search field is empty.

How to Connect an External Data Source and Report on It

NOTE: An external data source copies rows from another system into Pabau so you can report on them. Pabau keeps its own copy and refreshes it on the schedule you choose; it never changes your clients, appointments or other Pabau records. Connecting, editing and deleting a source needs the Can access the Setup page permission. Anyone on your team can report on a source once it is connected.

Step 1: Open Data Studio

Go to Analytics → Data Hub and open the Studio tab. Click Connect external data source.

Data Hub → Studio, with the Connect external data source button

Step 2: Choose Custom API

The Add a data source panel lists the kinds of source you can connect. Choose Custom API, which connects any system that returns JSON over HTTPS (REST, or GraphQL sent as a POST). If the system you need is not listed, click Request it here.

The Add a data source panel

Step 3: Enter the Connection Details

  • Endpoint URL: the HTTPS address that returns your records.
  • Method: GET, or POST with a Request body (for GraphQL, the body is {"query": "…"}).
  • Headers: any extra headers the API needs.
  • Authentication: Bearer sends Authorization: Bearer <key>, Raw sends the key as it is in the header you name, or None. Paste the API key. Pabau stores it encrypted and never shows it again.
  • Records path: where the list of records sits in the response, such as data.items. Leave it empty if the response is the list itself.
  • Record ID path: the field that identifies each record, such as id. Pabau uses it to update a record it already has instead of adding it twice.

The connection details

Step 4: Preview and Choose Your Columns

Click Preview. Pabau calls the API once, shows how many records came back and lists the fields in the first record with a sample value. It suggests a column for each field; untick the ones you don't need, rename them, and check each column's type: Text, Number, Date, Date & time or Yes/No. Numbers can be added up in reports and dates can be grouped by day, week, month, quarter or year.

Choosing columns from the preview

IMPORTANT: A column's name is how you refer to it in PQL, so it cannot be changed after the source is created. You can add new columns and remove old ones later.

Step 5: Name the Source and Choose a Schedule

Give the source a name, for example Stripe margin. This is the object name you use in reports. Choose how often Pabau refreshes it (every 15 minutes, every hour, every day or manually) and what a refresh does:

  • Update matching rows adds new records and updates the ones it already has, keeping records the API no longer returns.
  • Replace all rows makes Pabau's copy match the API exactly, removing records it no longer returns.

Click Create. Pabau runs the first sync straight away and shows how many rows were added.

The first sync

Step 6: Manage Your Sources

Connected sources are listed under External data sources on the Studio tab, with their row count and last sync. Use a source's menu to Sync now, see its Sync history, Edit it, open it in the Data Explorer, create a report, or Delete it (which deletes Pabau's copy of its rows).

External data sources on the Studio tab

Step 7: Explore the Data with PQL

Click Open in Data Explorer, or pick the source under External data in the Data Explorer's object picker. Filter it like any other object, or write PQL against it, for example:

object = 'Stripe margin' AND Month = 'LAST MONTH' GROUP BY Client SHOW SUM(Net profit) AS 'Net profit' ORDER BY 'Net profit' DESC

Every source also has Record key, First seen, Last updated and Last synced fields. Save the query as a dataset to use it in Power BI or Excel, as described in How to Save Data Studio Datasets and Connect Power BI/Excel Feeds.

A source in the Data Explorer

Step 8: Build Reports and Dashboards

Click Create report on the source, or start a PQL report from the report builder. A grouped query can be shown as a table (with a totals row), a bar, pie or donut chart, or as KPI tiles, which show the first row's figures and the change against the second row. Set each measure's format to count, number, money or percent, save the report and add it to a dashboard.

A report on an external data source

Step 9: Use a Source in Workflows

In the workflow builder, a source appears wherever you can write PQL. Use a scheduled PQL trigger to start a workflow for the rows that match a query, or a PQL Lookup step to read values from a source in the middle of a workflow.

TIP: Limits: up to 25 sources per clinic, 10,000 records per sync, and per source up to 40 text, 40 number, 10 date, 10 date & time and 10 yes/no columns. Text values are cut to 255 characters. Reports show the data as of the last sync, so pick a schedule that matches how fresh you need it. To keep Pabau's own records in step with another system instead, see How Data Sync Works in Pabau.