Overriding connector parameters in reports

Data source parameters allow report editors to override default configuration values in a data source while editing a report. This makes data sources more flexible, and gives editors another way to easily create report templates.

Example

For example, if you create a Community Connector providing weather data based on ZIP codes, a user will have to create a new data source for each ZIP code they are interested in. Instead if you define the ZIP Code parameter as overridable, the user will be able to create a single data source and override the ZIP code parameter in reports.

The following diagram shows how the parameterControl property can be used in getConfig() configParams to allow overridable parameters. The right side shows the result of the parameterControl setting in the Connector configuration screen:

Allowing override in
configParams

Once the user allows modification of ZIP code in the Connector configuration screen, the default value for ZIP code can be overridden for any chart element in the report using the connector. The following diagram shows the default ZIP code value of '94043' in the connector configuration screen and the overridden value '20001' for the selected table in the Data Studio Report:

Enabling override
option

Deciding whether to make a parameter overridable

To use this feature in your Community Connector, you should first understand how Connectors, Data Sources, and Reports work in relation to each other in Data Studio. Learn more about this at Support Center: How Data Studio connects to your data.

  1. Ensure that the schema does not change when the overridable value is changed. If the schema changes, it might break your data source and report.
  2. Consideration should be made for parameter values that could unintentionally share sensitive data. E.g. if a parameter controls an account selection.

Defining configurable parameters

To allow overriding of a configParam entry, add the following:

parameterControl: {
  allowOverride: true
}

For example, the following connector's configParams has three parameters:

  • A text input for ZIP code that can be selected to be modified in reports.
  • A single select for Unit of measurement that is fixed at data source creation.
  • A text input for entering number of days.

The following code enables overriding for the first two parameters:

var configParams = [
    {
      type:'TEXTINPUT',
      name: 'ZipCode',
      displayName: 'ZIP Code',
      parameterControl: {
        allowOverride: true
      }
    },
    {
      type: "SELECT_SINGLE",
      name: "units",
      displayName: "Units",
      parameterControl: {
        allowOverride: true
      },
      options: [
        {
          label: "Metric",
          value: "metric"
        },
        {
          label: "Imperial",
          value: "imperial"
        },
        {
          label: "Kelvin",
          value: "kelvin"
        }
      ]
    },
    {
      type:'TEXTINPUT',
      name: 'Days',
      displayName: 'Days to forecast'
    }
];