Data Studio Connector fields get an update

The engineers at Google continue to roll out updates to Data Studio at a relentless and impressive pace.

Back in September they released community connectors, which allow you to connect any web service with an API to Data Studio for reporting.

Yesterday, they released an update which gives developers much more control over the connector fields in Data Studio, by allowing developers to define Data Types and Semantic Types with more granularity, in your Apps Script code.

Additionally, developers can now embed calculated fields into the connector’s schema too, so it’s not left up to the user to figure this out.

This is a huge improvement as it obviates the need for the end user to select the correct field settings (for example, which aggregation to use) and should therefore make it easier for users to build accurate reports.

Data Type and Semantic Type features in the connector fields

Previously, developers only had limited control over the fields defined in the connector Schema. You could set the data type, whether it was a dimension or metric and whether it could be aggregated or not.

But that was about it.

You couldn’t define what that aggregation was for example, and you were limited to NUMBER, STRING or BOOLEAN as for your data.

For example, previously you would have defined a field like this:

  name: 'crawl_date_hour',
  label: 'Crawl Date Hour',
  dataType: 'STRING',
  semantics: {
    conceptType: 'DIMENSION'

which would show up in the field list of Data Studio like this:

Connector fields

The Concept Type was DIMENSION, so the field shows up green. The Semantic Type shows up as TEXT, because that’s the default for a STRING Data Type.

This field still requires manual intervention from the user though, to change the field to the correct semantic type of Date Hour:

Manually change semantic type in connector fields

Inevitably, some users will forget to do this, or not understand how to do this.

And that’s why this new update is so important.

With this new update, developers are now able to define the Semantic Type and give the field a description. In this example, I can now define the field Semantic Type as YEAR_MONTH_DAY_HOUR and add a description:

  name: 'crawl_date_hour',
  label: 'Crawl Date Hour',
  description: 'Date and Hour in format YYYYMMDDHH eg 2017031407',
  dataType: 'STRING',
  semantics: {
    conceptType: 'DIMENSION',
    semanticType: 'YEAR_MONTH_DAY_HOUR',
    semanticGroup: 'DATETIME'

It will then show up as such automatically in the field list:

Data Studio connector fields semantic type

The description is super helpful when you have a large number of connector fields, so you can give users some guidance. You’re free to put whatever you want in this description (string format only).

Read more about Data Types and Semantic Types here.

Read more about the different Semantic Types here.

Defining Calculated Fields in your Schema

Ooh! This is the other exciting update.

Calculated Fields open up all sorts of new possibilities in Data Studio, so you can create the custom dimensions and metrics you want.

They’re a bit like spreadsheet formulas but they’re tricky to use and the editing window is tiny, so longer formulas are best written out in a text editor first and then copied into Data Studio.

Anyway, I digress, but the point is that you, as the developer of the connector, can now define calculated fields in your Schema in advance, thus saving the user the pain of figuring this out.

Read more about defining calculated fields in the Schema here.

One thought on “Data Studio Connector fields get an update”

  1. Hi Ben,

    With Calculated Fields, do you know of a way to calculate a `median` from a set of filtered results in Google Data Studio? I’d like to display a median result from filtered set of data from our gross_sales column.

    I am using =median(my_column_Name_which_is_a_number_currency) , but the reject message notes `could not parse formula`.

    Btw, your course Google Sheets and Data Studio Course has been super helpful!!

Leave a Reply

Your email address will not be published. Required fields are marked *