Skip to main content

What is a scope?

A scope is a filter which applies to a collection and all its segments. It is useful in that it can be used to control what data is available to users. More specifically, scopes can be set up to filter data dynamically on the current user.
Scopes are applied to the entire application excluding global smart actions, API & SQL charts and Collaboration & Activities.

Using a dynamic scope

Imagine a situation where you have several Operations teams each specialized in a specific country’s operations:
  • France team handles customers from France
  • Germany team handles customers from Germany
By scoping the collection on $currentUser.team.name, Marc who belongs to the France team will only see customers from France, while Louis who belongs to the Germany team will only see customers from Germany.

Dynamic variables

In the example above, we used the team name to filter out what the user sees: $currentUser.team.name Here the exhaustive list of available dynamic variables:
SyntaxResult
$currentUser.idThe id of the current user
$currentUser.firstNameThe first name of the current user
$currentUser.lastNameThe last name of the current user
$currentUser.fullNameThe full name of the current user
$currentUser.emailThe email of the current user
$currentUser.team.idThe id of the team of the current user
$currentUser.team.nameThe name of the team of the current user
$currentUser.tags.your-tagThe value associated with key your-tag for the current user, if any.

Using user tags

The above example is only possible if your data matches your users’ details (email, team, etc). It’s likely that it won’t always be the case. This is why we’ve introduced user tags. User tags are set from each user’s details page and allow you to freely associate your users to a value which will match against your data using the $currentUser.tags.your-tag dynamic variable.