Question

Parameter passing to dashboard

  • 29 October 2018
  • 2 replies
  • 173 views

I have dashboard d1 which has following


measure: qt_s_d {

type: sum

value_format: “#,##0

sql: ${TABLE}.qt_s ;;

html: {{ rendered_value }} | {{ qt_s_d1._rendered_value }} % of total;;

link: {

label: “Top 25 Query Details”

url: “/dashboards/2439?username={{ ‘abcd_efgh’ | url_encode }}”

}

link: {

label: “Top 25 Query Details1”

url: “/dashboards/2439?username={{ ‘abcdefgh’ | url_encode }}”

}

}


I am calling another dashboad d2 and passing username which is parameter for dashboard d2. The issue I am facing is that if the value of username that I am passing has _ character then d2 ignores it but if the value does not have _ then it uses it. so the first link above does not work but the second link works.


Thanks


2 replies

The Url that gets opened in first one is following


https://d-looker.zzz.zzz.com/dashboards/2439?username=abcd_efgh

https://d-looker.zzz.zzz.com/dashboards/2439?username=&filter_config={"username":[{"type":"%3D","values":[{},{}],"id":0}]}


If you see second line, the value of parameter username gets ommited.


for the second case above


https://d-looker.zzz.zzz.com/dashboards/2439?username=abcdefgh

https://d-looker.zzz.zzz.com/dashboards/2439?username=abcdefgh&filter_config={"username":[{"type":"%3D","values":[{"constant":"abcdefgh"},{}],"id":0}]}

Hello,


Thanks for reaching out to us, I replied via email but I thought it may be helpful for others to describe the behavior/solution here as well.


The username ‘abcd_efgh’ not being passed through is expected, because the underscore ‘_’ is a special character within the filter syntax. The workaround is to escape the underscore with a carat symbol ^. So in your example, ‘abcd_efgh’ should be ‘abcd^_efgh’ . Check out the first bulletpoint in this section for details on this behavior: link


Cheers,

Jon

Reply