Question

Set model connection name dynamically

  • 18 November 2022
  • 3 replies
  • 39 views

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?

 

 


3 replies

Userlevel 6
Badge

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).

Userlevel 6
Badge

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!

Reply