user_attributes URL parameter

Is there a way to access the user_attributes parameter that is coming in an embed URL? I need to capture this value to ask for it in a sql_always_filter.

The URL is like this:

https://xxxx.cloud.looker.com/login/embed/embed%2Fdashboards%2F3%3Fuser_attributes%3D%7B%22role%22%3... (...)

Maybe is there another way to solve this, I'm quite new using Looker.

Any suggestion is welcomed. Thanks.

Solved Solved
0 2 446
1 ACCEPTED SOLUTION

I solved it by changing the position where this user_parameter was place into the URL. Then, I defined an user_parameter with the same name (‘role’) and automatically Looker assigned it the value from the url.

View solution in original post

2 REPLIES 2

Hi Matias!

Perhaps Liquid and LookML will help:

Looker - User attributes values in liquid

sql_always_where:

{% if _user_attributes['name'] == 'value' %}

${view_name.field_name}={{_user_attributes['name']}}

{% else %}

1=1

{% endif %} ;;

Best,

Leo

I solved it by changing the position where this user_parameter was place into the URL. Then, I defined an user_parameter with the same name (‘role’) and automatically Looker assigned it the value from the url.

Top Labels in this Space
Top Solution Authors