Skip to content

Commit fd4cd20

Browse files
committed
Add dashboard filter support to user attributes docs
1 parent c76aae0 commit fd4cd20

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

27.7 KB
Loading

references/workspace/user-attributes.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ User attributes can be used in these specific contexts within the model.yaml fil
5454

5555
User attributes can also be used in:
5656

57-
- **Chart filter values** - Filter charts dynamically based on the logged-in user
57+
- **Chart and dashboard filter values** - Filter charts and dashboards dynamically based on the logged-in user
5858

5959
<Info>
6060
User attributes cannot currently be referenced inside`sql:` tags within the model YAML files.
@@ -111,9 +111,9 @@ When referencing user attributes in SQL you can use the following [SQL variables
111111
If you are self hosting you can enable [SMTP](/self-host/customize-deployment/configure-smtp-for-lightdash-email-notifications) or [SSO](/self-host/customize-deployment/use-sso-login-for-self-hosted-lightdash) authentication to allow users to verify their email address.
112112
</Info>
113113
114-
### Using user attributes in chart filter values
114+
### Using user attributes in chart and dashboard filter values
115115
116-
You can reference user attributes directly in chart filter values to create dynamic filters based on the logged-in user. This is useful for creating charts that automatically filter to show only data relevant to the current user.
116+
You can reference user attributes directly in chart and dashboard filter values to create dynamic filters based on the logged-in user. This is useful for creating charts and dashboards that automatically filter to show only data relevant to the current user.
117117
118118
To use a user attribute in a filter value, enter one of the following references:
119119
@@ -122,6 +122,10 @@ To use a user attribute in a filter value, enter one of the following references
122122

123123
For example, if you have a chart showing sales data and you want each user to only see their own records, you can add a filter where `sales_rep_email` is equal to `${lightdash.user.email}`. When the chart runs, the filter value will be replaced with the actual email of the logged-in user.
124124

125+
The same references work on dashboard filters, so a single dashboard can be shared with many users and each will only see the rows relevant to them.
126+
127+
![Dashboard filter using a user attribute as its value](/images/references/workspace/user-attribute-dashboard-filter.png)
128+
125129
Similarly, you can use custom attributes like `${lightdash.attribute.country}` to filter data based on a user's assigned region or department.
126130

127131
<Info>

0 commit comments

Comments
 (0)