3
votes

I have a Google DataStudio Reports, with an "account ids filter", for example I may have 100 client accounts.

I want to share this report with these 100 accounts. But each account should only see their own report.

But Google DataStudio does not take parameter from url, so I cannot pass account id value into the DataStudio report url to filter out the report accordingly.

I have a thought. What if I use Google Apps Script to create a Google Data Studio data connector, and use this data connector as the data source for my Google DataStudio reports.

Then I will share this report with my 100 client accounts.

Each client account will access this report (the data source is Google Apps Script data connector). And the Google Apps Script data connector would run under this client's google account. and the Google Script will do the following jobs, authenticate the this account, know which account it is based on this account's google account, fetch the data of this account only , as data source for the Google DataStudio Report. This way, each client would get the report for himself/herself.

Would that work? Do anyone have resources or codes can share for this problem and this solution?

1

1 Answers

3
votes
  1. In your connector code, use getEffectiveUser() (reference) to get the user's Id and filter your data by that.
  2. Using your connector, create a data source and enforce viewer's credentials.
  3. Create a dashboard from that data source.

When your clients view the dashboard, they will have to authorize the connector the first time. Then they will only see data that is applicable to them.