How to override disabled suggestions with access_filter_fields and sql_always_where (prior to 3.34)


As of Looker 3.34, we have introduced a full_suggestions parameter, which allows you to have filtered suggestions for fields when there are access filter fields or sql_always_where. Read about how to do this here. Please use this option instead of bypass_suggest_restrictions to avoid security issues.

If you really, really want unfiltered suggestions, read on at your own riskā€¦ :scream:

Overriding disabled suggestions can expose users to values they should not have access to. Suggestions are disabled by default so that users do not see data they do not have access to. Before enabling suggestions, do extensive testing to ensure users are not seeing sensitive data.

###What are access_filter_fields and sql_always_where?
access_filter_fields and sql_always_where can be used to place restrictions on all queries in an explore. access_filter_fields allows for user-based restrictions, where each user can have different data restrictions that are placed in the WHERE clause of each query. sql_always_where imposes an unchangeable WHERE clause on all queries from a specific explore.

###Suggestions are disabled by default

By default, filter value suggestions in the UI are disabled when access_filter_fields and sql_always_where are used in an explore. This is in order to prevent values from being suggested in the filter that users should not being seeing.

###How to enable suggestions - dangerous, be very careful

When suggestions are enabled, values may be suggested that user shouldnā€™t be seeing. Be very cautious AND do extensive testing when enabling suggestions with access_filter_fields or sql_always_where to ensure users arenā€™t seeing values they should be.

If you would like to enable suggestions for a specific field when using access_filter_fields or sql_always_where, add bypass_suggest_restrictions: true to the definition of the field you want to suggest from. This would look something like:

- dimension: state
  sql: ${TABLE}.state
  bypass_suggest_restrictions: true

This will enable suggestions when this field is used in a filter for all users.

###More information about suggestions

If suggestions are enabled, it is possible to explicitly specify which values can be suggested. Read more about optimizing suggestions here. Other suggestion parameters on fields include:

suggest_explore and suggest_dimension

1 Like

(Leland) #2

Didnā€™t realize this was part of the 3.22 release! This will be very helpful for us!