Skip to main content
Organization Admin permissions are required to create and modify user attributes, including assigning them to users.
User attributes allow you to map user-specific variables to Omni operations, such as querying, dashboarding, and data access. These attributes can be used in dashboard filters or workbooks or to filter embedded content. The user attributes settings page, showing a list of defined attributes.

User attribute basics

Yes. User attributes can be used in a few ways to control data access:
  • Access filters, which allow you to restrict the rows of data a user can access within a topic. Access filters apply the values assigned on a user attribute to the WHERE clause of every SQL query a user runs, filtering out to only the data designated to that user:
    Filter by brand_name
    access_filters:
      - field: products.brand
        user_attribute: brand_name
        values_for_unfiltered: [all_brands]
        enable_sql_like_wildcards: true
    
  • Access grants, which define topic- and field-level permissions. Omni will map a user’s attribute value to a corresponding allowed value and determine if the user has the necessary permissions to access that topic or field:
    Grant access for user group
    access_grants:
      blob_sales_access:
        user_attribute: "omni_user_groups"
        allowed_values: ["Blob Sales"]
        access_boostable: false
    
  • Fields. User attributes can be referenced in fields using Mustache syntax, for example: {{ omni_attributes.<attribute-name> }}. This construct can be used to:
    • Provide conditional access to a field, or
    • To hash a field based on a user attribute. This can be done by using a CASE statement in the SQL definition for a field. For example, the following name_hidden and name_hashed examples demonstrate how to use user attributes to hide or hash a name field as an alternative to using access grants to remove access entirely:
      Hide or hash field based on user attribute
      name:
        sql: ${users.full_name}
      
      name_hidden:
        sql: |+
          CASE 
            WHEN {{omni_attributes.see_names}} = 'true'
            THEN ${users.name}
            ELSE 'No Access'
          END
      
      name_hashed:
        sql: |+
          CASE 
            WHEN {{omni_attributes.see_names}} = 'true'
            THEN ${users.name}
            ELSE MD5(${users.name})
          END
      
Yes. User attributes can be used to parameterize the connection queries run against while in an Omni branch. Refer to the Dynamically switching database environments guide for more information and setup steps.
Yes. Shared extension models use user attributes to route users to the correct model extension. You define a mapping in the parent model’s dynamic_shared_extensions parameter that links user attribute values to specific extensions.
Yes. There are a few ways to do this:
  • Dashboard Markdown tiles. You can use user attributes in dashboard Markdown tiles with Mustache syntax. For example, {{metadata.userAttributes.<user_attribute>.values}} would return the value of the specified user attribute.
  • Dashboard deliveries. User attributes can be used to personalize deliveries, including messages (where supported) and the data included in the delivery.
Yes. The steps for assigning a user attribute are the same regardless of user type. To view email-only users when working with a specific attribute, click the Email Only toggle in the attribute’s Users tab:The Email Only toggle highlighted in the Users tab of a user attribute.
Yes. Refer to the Default system attributes section for more information.

Creating user attributes

To define a new user attribute, navigate to Settings > Attributes and click the New Attribute button. Each user attribute has the following settings:
  • Name: The name of the user attribute, how it will be displayed in the UI
  • Reference: How the attribute will be referenced in code, such as in the model
  • Type: Used to check that valid values are assigned to users. String and Number data types are allowed.
  • Multiple values: Specifies whether multiple values can be assigned to a user for this attribute
  • Description: Explanation of the attribute or how it will be used
  • Default value: Optional. Set a default value that all users will inherit if a value is not directly assigned to them.
    Be careful when setting a default value for attributes that are used in access filters or access grants. You could unintentionally grant access to data.
The new user attribute form with fields for name, reference, type, multiple values, description, and default value.

Assigning attributes to users

The steps in this section apply to all user types, including email-only and embed.
After defining a user attribute, you can assign values to individual users.
1
Navigate to Settings > Attributes.
2
Click the attribute you want to set.
3
In the attribute’s page, click the Users tab.
4
In the list of users, locate the user you want to work with. Use the toggles above the table to filter the list to a specific user type:
  • Org Users - View only standard users that can log into Omni
  • Email Only - View only email only users
  • Embed Users - View only embed users
  • All - View all users, regardless of type
This allows you to quickly locate and define attributes for specific user types, such as email-only users.The user type filter toggles above the users table, with options for Org Users, Email Only, Embed Users, and All.
5
In the dialog that displays, enter the value for the user.
6
Click Save.
After updating, the Source field will show whether the value is the default value or if it was set specifically for the user.

Default system user attributes

System attributes are read-only.
Omni’s default user attributes will be marked with a System badge in the Settings > Attributes page.
omni_is_org_admin
boolean
If true, the user is an Organization Admin.
omni_user_email
string
The user’s email address.
omni_user_embed_entity
string
The user’s embedded entity name. For example, Blobs R Us
omni_user_groups
string
The user groups that the user is a member of. The value will be a comma-separated list of user group names, for example Blob Sales, Blob Marketing
omni_user_id
string
A unique identifier for the user. For example, 91abbe19-b0de-4537-bc62-cec1d95420c9
omni_user_locale
string
The user’s locale code. Possible values are:
Locale codeLanguage
en-USEnglish (default)
de-DEDeutsch (Deutschland)
es-CLEspañol (Chile)
es-ESEspañol (España)
fr-FRFrançais (France)
he-ILעברית (ישראל)
ja-JP日本語 (日本)
See the Localization guide for more information.
omni_user_name
string
The user’s name. For example, Blob Ross or Blobby Parton
omni_user_timezone
string
The user’s timezone, which is set using the Query timezone setting on the user’s profile. For example, UTC or America/Los_Angeles