(Showing Draft Content)

User-context Based Parameters in a Data Set

User-context attributes are used to dynamically filter the data within a dataset based on a certain user attribute such as username, email, mobile, or any custom property. It means, a logged-in user can only view the data based on his user-context value set by the administrator in the Admin Portal. Note that when you want to add a parameter based on a user-context attribute, you should make sure that the dataset contains similar field as that of the user-context attribute.

For more information, refer to the following articles-

Filter Data Based on User Context Value

Consider a scenario where you want the regional managers of BC, OR, and WA to view the data only for their respective regions. It means, the regional manager of region BC can only view the data for region BC, similarly, the regional manager for region OR can only view the data for region OR, and so on.

  1. On the Admin Portal, navigate to Account > Custom Property to add a new property 'region'.

    Custom Property interface

  2. Then, jump to Users and specify the region values for the users.

    Set User's Attribute Values

  3. On the Resource Portal, go to Dataset, select a dataset and click Edit.

  4. In the dataset designer, navigate to the Parameters tab and click Add Parameter button.

    Parameters tab in Dataset Designer

  5. Set the properties for the new parameter such as its type, data type, and context field. In the following example, Parameter Type is set to 'User Context', Data Type to String, and Context Field to 'region'.

    Set Parameter Properties in the Parameters tab of the Dataset Designer

  6. To filter the data based on the parameter value, jump to the Filters tab of the designer and click the Add rule button to add a dataset filter.

    Dataset Designer

  7. Now, specify the filter properties such as the field on which you want to apply the filter, filter value type, and its value. In the following example, set the Field to 'Region', ValueType to 'Parameter', and Value to 'Parameter1'. This will now filter the data based on the user's region value.

    Set Filter as Parameter

  8. Finally, click the Save button.