Skip to main content
External sources are experimental, and the flow, limits and wording on this page may change between releases. Self-hosted instances need an Enterprise license and the setup below.
An external source brings data that lives outside your warehouse into a project: an uploaded CSV, or a tab of a Google Sheet. Lightdash reads it once, stores a typed copy, and turns it into a table you can explore, chart and put on dashboards. Nothing changes in your dbt project. Use it for small, hand-maintained data that never made it into the warehouse, such as monthly targets, a mapping of regions to owners, or a list of accounts to watch.
The Channel targets table from a Google Sheet, with Target month and Sum of Revenue target (USD) selected and the results by monthThe Channel targets table from a Google Sheet, with Target month and Sum of Revenue target (USD) selected and the results by month

A Google Sheet of monthly targets, explored like any other table

Before you start

  • Editor role or above. Editors, developers and admins can add, refresh, rename and delete external sources. Everyone else in the project sees the tables, and the charts built on them follow normal space permissions.
  • A header row. The first row names the columns. Every following row is data.
  • For Google Sheets, access to the sheet. The first time you connect a sheet, Lightdash asks your Google account for access to Google Sheets and to the Drive files you pick.
  • Size limits. Up to 100 MB per file, 1,000,000 rows per table and 5 GB per organization.
Everyone in the project can see an imported table, whatever the Google Sheet’s own sharing settings. Lightdash reads the sheet with the Google access of the person who connected it and stores a copy. User attributes and row-level filters don’t apply to external sources, so only import data that every project member may see.

Upload a CSV

1

Open the Semantic Layer page

On the nav bar, click Browse → Semantic Layer.
2

Add an external source

Next to the search box, select Add, then External source. If an external source is the only thing you can add, Add opens the upload dialog directly.
The Semantic Layer page with the Add menu open next to the search box and External source highlightedThe Semantic Layer page with the Add menu open next to the search box and External source highlighted
3

Drop your file

Drop a CSV on the upload area, or click it to pick a file.
The Upload a CSV dialog with a drop area and a link to connect a Google Sheet insteadThe Upload a CSV dialog with a drop area and a link to connect a Google Sheet instead
4

Name the table and its columns

Give the table a name and check the type detected for each column. Rename any column whose name reads oddly, then select Create table. Lightdash opens the new table as soon as it’s ready.
The CSV preview with the table name sales_targets and editable names for each column, with the month column renamed to TargetThe CSV preview with the table name sales_targets and editable names for each column, with the month column renamed to Target

Connect a Google Sheet

1

Paste the sheet link

Open the upload dialog as described in Upload a CSV, then select Connect a Google Sheet instead. Paste the sheet’s URL from your browser and name the table.Lightdash reads the tab the link points to. Open the tab you want before copying the URL, so the link ends in #gid=…. A link without a tab reads the first tab.To bring in several tabs of one sheet, connect each tab as its own source with its own table name. Each tab appears as a separate table in Explore and Data Apps.
The Connect a Google Sheet dialog with a sheet URL and the table name channel_targetsThe Connect a Google Sheet dialog with a sheet URL and the table name channel_targets
2

Connect your Google account

Select Connect sheet. If you haven’t connected Google before, select Connect Google account, approve access in the pop-up, then select Connect sheet again.If it fails with Failed to refresh token: invalid_grant: Token has been expired or revoked, your stored Google authorization expired or was revoked, and the dialog doesn’t show a Connect Google account button for this error. Sign in to Lightdash, open <your Lightdash URL>/api/v1/login/gdrive, and approve access to Sheets and Drive with the Google account that can open the sheet. Then select Connect sheet again.
3

Review the table

Once the import finishes, rename the table or any column, then select Open table.
The Review your table step listing seven imported columns with editable names, types and an Open table buttonThe Review your table step listing seven imported columns with editable names, types and an Open table button

What the table contains

Each column becomes a dimension with a detected type: string, number, date, timestamp or boolean. Date columns also get day, week, month, quarter and year breakdowns. Lightdash adds a Total rows metric, plus a sum and an average for every number column. Column names are tidied into SQL-safe names, so Região becomes regiao and a column called month becomes _month. The name you see in the sidebar is the one you gave it while importing, or a readable version of the SQL name.

Use with warehouse data

You query an external source table on its own. It isn’t listed in the table picker of a merge query, so one chart can’t join it to a warehouse table. To see both together, add a chart from each to the same dashboard. A saved merge chart that includes an external source table still runs.

Keep the table up to date

An external source is a copy taken when you import it, and edits to the sheet or file don’t show up until you refresh it. In Explore, the menu next to the table name holds the source actions:
  • Refresh from Google Sheets reads the sheet again. Column names you set are kept.
  • Replace file uploads a new version of a CSV.
  • Reconnect Google account makes your Google access the one used for future refreshes, for example when the person who connected the sheet leaves.
  • Rename table changes the table and column names. Saved charts keep working.
  • View source details previews the columns and the first rows.
  • Delete removes the table. Charts built on it stop working.
If a refresh fails with invalid_grant, re-authorize Google as described in Connect a Google Sheet, then select Reconnect Google account so the source uses the new grant. Reconnect Google account on its own doesn’t open a Google prompt.
A source stores the name of the tab you connected. If you rename that tab in Google Sheets, Refresh from Google Sheets fails. Connect the renamed tab as a new source: either give it a new table name, or delete the old source first and reuse its name.
The source menu next to the Sales targets table name, a CSV file, listing Replace file, Rename table, View source details and DeleteThe source menu next to the Sales targets table name, a CSV file, listing Replace file, Rename table, View source details and Delete

The source menu for a table from a CSV. A Google Sheet table lists the refresh and reconnect actions in place of Replace file

The Semantic Layer page lists every source under External sources with its row count, last refresh and status, and each row has a menu to preview, refresh, reconnect, replace, rename or delete it.
The Rename table dialog with the table name and an editable name for every column, with channel renamed to Sales channelThe Rename table dialog with the table name and an editable name for every column, with channel renamed to Sales channel

Renaming a column from Rename table

Self-hosted setup

External sources run on the same DuckDB engine and object storage as pre-aggregates, but they don’t need pre-aggregate workers or NATS. You need:
  • An Enterprise license. Set LIGHTDASH_LICENSE_KEY. See enterprise features.
  • A bucket for the imported data. Set the PRE_AGGREGATE_RESULTS_S3_* variables listed under pre-aggregates. Lightdash stores each table under external-sources/ in that bucket. Without them, adding a source fails with External sources need the pre-aggregates DuckDB configuration (PRE_AGGREGATE_RESULTS_S3_*).
  • For Google Sheets, a Google OAuth client. Follow configure a Google Sheets integration. Enable the Google Sheets API and the Google Drive API on the same Google Cloud project, and add <SITE_URL>/api/v1/oauth/redirect/google to the client’s authorized redirect URIs.
External sources don’t use a feature flag, so adding external-sources to LIGHTDASH_DISABLE_FEATURE_FLAGS doesn’t turn them off. To stop people adding sources, give them a custom role without manage:ExternalSource. To change the size limits, set EXTERNAL_SOURCES_MAX_FILE_SIZE_BYTES, EXTERNAL_SOURCES_MAX_ROWS or EXTERNAL_SOURCES_MAX_ORGANIZATION_BYTES.