Data masking with system variables

ThoughtSpot now supports the ts_groups system variable in Answer and Worksheet formulas. You can use the ts_groups variable for data masking, or deciding whether to display the value of a column to a user based on their group membership. Note that the returned masked value must match the column type; for a measure, it must return null or a number value, for an attribute, it must return null or a string.

Using data masking for measures

You can use the ts_groups variable to enforce whether users are able to see measures, like Revenue, in their searches. For example:

  1. Search for Category Color Revenue.

  2. Click + Add in the side menu and select Formula.

  3. Name your formula (for example, "fxrevenue").

  4. In the Formula editor window, enter the following formula: if( ts_groups = 'administrator' or 'secure' in ts_groups) then Revenue else null. Click Save.

    This formula allows any user within the Administrator or Secure groups to see the Revenue data. All other users see null data.

    Note that both syntaxes, "ts_groups= 'administrator'" or "'secure' in ts_groups" are supported.

Using data masking for attributes

You can use the ts_groups variable to enforce whether users are able to see attributes, such as Category, in their searches. For example:

  1. Search for Category Color Revenue.

  2. Click + Add in the side menu and select Formula.

  3. Name your formula (for example, "fxcategory").

  4. In the Formula editor window, enter the following formula: if( ts_groups = 'administrator' or 'secure' in ts_groups) then Category else '**'. Click Save.

    This formula allows any user within the Administrator or Secure groups to see the Category data. All other users see a string of asterisks.

    Note that both syntaxes, "ts_groups= 'administrator'" or "'secure' in ts_groups" are supported.


Was this page helpful?