Set model connection name dynamically

Hi,

I cannot believe this is so difficult to find an answer to.

We are embedding Looker dashboards via SSO signed URLs in an iframe. This iframe will be served in different client environments, and of course we need a separate connection per environment. We need to be able to set a model connection NAME dynamically, possibly via user attributes.

The link below talks about parameterised connections, but I don’t want to get PARAMETERS of a connection from user attributes, I want to set connections in my connections list, and then based on a user attribute value choose one of these connections. So in my model LookML I would have:

connection: {{_user_attributes[‘connection’]}}

Is this possible?

https://community.looker.com/lookml-5/dynamic-connections-for-models-8824
2 6 1,232
6 REPLIES 6

IanT
Participant V

The link you posted is talking about connection config using user attributes (admin stuff) - read about creating connections to see if the things you can change there using user attributes would work for you (eg change of a schema or gcp project).

IanT
Participant V

And no not possible to do as you are trying.

Thanks @IanT - yeah it doesn’t look possible the way I want to do. But surely this is such a common need, people have different testing and staging environments. I cannot be expected to provided username/password/hostname.. etc as part of user attributes, I’m embedding the reports, so that is not even an option, my user attributes go in a URL!

@uglyprince I have raised the same request with looker support on 12 December 2022. This one is really a good to have feature.

@IanT https://cloud.google.com/looker/docs/admin-panel-users-user-attributes#connections

User attributes in connection parameter works fine for most DBs but not for GCP BIGQUERY, because it requires credentials file below which cannot be dynamically passed based on user attribute. This is causing a lot of complexities in switching between environments..

Service Account JSON/P12 File

Is there any update on this?
We are using OAuth in Snowflake and we require different settings, expiration tokens, etc. for different users (none of the above seems to be accessible through user_attributes). Having the option to switch between connection names for different users would unlock critical functionality that is preventing us from going live.
Thanks!

I was told this is working in my onboarding and its not possible?

Top Labels in this Space
Top Solution Authors