There are
no formula function that will return the user's
role. Moreover, a user can be in multiple roles at once so any potential function would have to return all roles.
However you can obtain this information using
script and the
API method
API_GetUserRole. Here is the
XML Response for me calling
API_GetUserRole on an application where I am in both the
Administrator role and Basic
Access with Sharing role:
http://pastie.org/10331624Since there is an API method that returns this information you should use it an
not dip into the pool of
Global Variables where QuickBase for its own purposes has some of the same information in the source of its pages. But on the other hand there is no harm in poking around and understanding what global variables are within QuickBase pages. See the attached screenshot of the
developer console where three global variables that contains role related information and logged.
Pastie Databasehttps://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=439R>I would just grab the value, do a case statement ...
If there was no API method that returned the roles (but there is), I would use underscore and gReqUserRoleIIDs (plural) the object gRofo to return all the roles the current user is a member of. 