Skip to main content
A newer version of this page is available. .

User-Specific Functions

  • 2 minutes to read

The Report and Dashboard Server provides the following functions that enable you to access information about the current user:

  • UserName()

    Returns the current user’s name.

  • UserEmail()

    Returns the current user’s email.

  • IsMemberOf(userGroupName)

    Returns true if the current user belongs to a group defined by the userGroupName parameter.

You can use these functions to make a data model return specific data subsets to different users. This restricts access to sensitive information in your database. Users cannot access and modify these functions unless they have the permissions.

However, non-privileged users can use these functions at the document level (to further filter data available to them).

Data Model Level

Apply a user-specific function to a data model query’s filter string to define the users to which the query data is available.

For instance, specify the following filter string to display only orders shipped to a country that corresponds to a user’s group (that is, a user from the USA group should not see orders shipped to other countries):

user-specific-functions-data-model-query-filter-string

For this function to take an effect, the Report and Dashboard Server should contain user groups for each country listed in the [ShipCountry] data column.

Document Level

Report and Dashboard Server users can apply these functions at the document level.

Do the following to apply a user-specific function to a report‘s query:

  1. Select a query in the Field List and click its Edit Query button.

    report-designer-data-source-query-edit

  2. On the invoked wizard page, create a new filter condition and select Function as a value source.

    report-designer-data-source-query-filter-string

  3. Click the value placeholder and select a user-specific function.

    report-designer-data-source-query-filter-string-user-name

Do the following to apply a user-specific function to a dashboard‘s query:

  1. Open the Data Sources screen, select a query and click its Edit Query button.

    dashboard-data-sources-edit-query

  2. Add a new filter condition and select Function as a value source.

    dashboard-data-sources-filter-function

  3. Click the value placeholder and select a user-specific function.

    dashboard-data-sources-filter-function-user-name