Last tested: Nov 2020
Enable User-Specific Timezones in the Admin panel.
Add the user_timezone
as one of the embed URL parameters when generating the embed URL.
After the embed URL loads the dashboard, the embed user can switch to Viewer Timezone in the timezone dropdown menu at the top right.
Steps 1 and 2 stay the same. Instead of having the embed user switch the timezone in Step 3, use one of the following options.
Option 1: Save the dashboard with the default timezone "Viewer Timezone". This will use the user's timezone as default for both embed users and non-embed users.
Option 2: We can add &query_timezone=user_timezone
as part of the dashboard URL. This will make the user's timezone selected by default even if it is not the saved default timezone for the dashboard. Note that the user_timezone
is one of the embed URL parameters, but the query_timezone
is not an embed URL parameter; it is part of the target URL.
Example of correct body for create_sso_embed_url call:
{
"target_url":"https://instance.looker.com/dashboards/1527?query_timezone=user_timezone",
"external_user_id":"1024",
"permissions": ["access_data", "see_user_dashboards"],
"models": ["the_model","mysql_model"],
"user_timezone":"America/New_York"
}
Resulting URL: https://instance.looker.com/login/embed/%2Fembed%2Fdashboards%2F1527%3Fquery_timezone%3Duser_timezone?permissions=%5B%22access_data%22%2C%22see_user_dashboards%22%5D&models=%5B%22the_model%22%2C%22mysql_model%22%5D&signature=dSJvLa12HrrRm55wVuriAS88vqk%3D&nonce=%229efba36c2749dd09c4b7dc193e391f54%22&time=1606708248&session_length=300&external_user_id=%221024%22&access_filters=%7B%7D&force_logout_login=true&user_timezone=%22America%2FNew_York%22
Example of INCORRECT body:
{
"target_url":"https://instance.looker.com/dashboards/1527",
"external_user_id":"1024",
"permissions": ["access_data", "see_user_dashboards"],
"models": ["the_model","mysql_model"],
"user_timezone":"America/New_York",
"query_timezone":"user_timezone" #DON'T DO THIS
}
Although the user timezone is set and query_timezone is passed as mentioned above, when creating a new tile in a dashboard, the timezone is set to Application timezone