0
votes

I have a data studio report that will show different data based on different users. I developed appscript and expose it as Community Connector so that I can control type of data to return back to data studio.

In my appscript, I'm using Session.getActiveUser() to track the current user. When I tried to open up the data studio report link using different gmail account, my appscript log shows that Session.getActiveUser() always returns the same email.

I even deployed the appscript as

  • Web APP > execute as user accessing the app
  • Add On
  • Library

How can appscript Session.getActiveUser() can return detect the current user who is access the data studio report link? Or is it the right way to do it?

1

1 Answers

0
votes

According to the documentation, you'll need to use Session.getEffectiveUser to determine the user's identity. https://developers.google.com/datastudio/solution/blocks/user-identity

This answer also describes what to expect depending of if the data source is set to 'Owner's credentials' or 'Viewer's credentials'