4

I'm using Google Data Studio to visualize results from various queries (from different tables within the same BigQuery-database).

For this reason, I created and use multiple data-sources-connectors. Each one of them has a SQL query included and makes use of an defined input parameter (which can be changed by report editors) - called "userid". It is the same id for all queries and resulting charts.

However, when I click "Manage URL parameters", I'm not allowed to use the same URL parameter for more than one data source (instead they are called ds0, ds1, ds2 etc - although they all end up being used as "userid").

If I add a data source under File - Report Settings, a new field "userid" appears, which I can alter - this will update ALL charts in the report with the very same userid (as expected). This works, but I do want to make use of an url which delivers an report with all updated queries depending on ONE userid.

Therefore, I guess I'm overseeing something - it should be possible to just use one query parameter to update the same "userid" for all queries in all data connectors? Or have I overlooked the possibility to fire multiple queries within one data source connector? Or is it expected to create a looong url full of redundant query parameters in this case?

I'm curious for your input!

Best regards :)

workah0lic
  • 91
  • 8

2 Answers2

1

There does not seem to be any good solution for this.

For now the best workaround seems to be to just repeat the parameter multiple times -- it's ugly but it works. For example, use the URL parameter mapping screen to call the parameter u1, u2, etc., and then just pass all of them:

?params={"u1":"foo","u2":"foo"}

(URL encoded of course)

The ugliness is mostly for us developers: it violates our sense of DRY and clean code, and makes the URL much longer than it needs to be. However, most people don't care or know about the URL parameters so its irrelevant to them.

The bigger downside is that when the URL is distributed to clients (bookmarks, mobile apps), every time new data sources are added that require the same URL parameters, a new URL has to be distributed to clients for no good reason. A workaround for this is to build the URL dynamically via a simple redirector function.

This issue https://issuetracker.google.com/issues/180705297 is a feature request to implement this capability.

Raman
  • 17,606
  • 5
  • 95
  • 112
-1

If you group the elements that you want to control with the same parameter (select and then shift G) then it will give you options to select the data source and the params box to apply to the group.

Ali
  • 22
  • 1
  • I'm still confused :) I understand the OP's question as I'm having the same problem. However, based on your response, I still don't see how to override multiple query parameters with a single URL param. It looks like, with your method, I can manually type in one param value to affect multiple queries in the editor, but I'm still left with having to specify the same param value in the URL query multiple times.. i.e.. mydomain?params={"ds1:userid": 100,"ds2:userid": 100,"ds3:userid": 100}. Am I missing something? Thanks! – Jim Ott Apr 21 '20 at 17:16
  • 1
    This does not seem to work in my opinion. Grouping seems to work when you have one datasource for all elements. What we are looking for is using multiple datasources to keep the code in the datasouce connector clean, but share one url parameter across all connectors – Mischa Molhoek Jan 12 '21 at 09:53