Defined Relationships
Last updated
Last updated
Defined Relationships allow you to create relationships between your users and your data that may not exist by default in ServiceNow.
By default, ServiceNow recognizes a limited set of relationships for a user as part of their session. These are
Groups
Department
Company
Location
However, many organizations may need additional relationships such as Business Unit, Agency, etc. In these cases, you can create a Defined Relationship.
To create a Defined Relationship:
Click 'New' on the Defined Relationship related list at bottom of the Separation Rule form
Provide a Name for the Defined Relationship
Set the Field on the Separation Rule target table where this relationship exists. For the example of Business Unit, the field would likely be called 'Business unit'. This setting lets Simple Data Separation where to apply the relationship you create, and allows you to maintain the convenience of auto-code-completion when using that field on your Separation Rule.
Create a Script to gather the value for this relationship for the logged-in user. The return value of the script should be an array of values for which the logged-in user is a 'member'. For the example of Business Unit, the script could be as simple as
Once the Defined Relationship exists, you can use the selected field as a Separator field on your Separation Rule just as you would use any normally supported field.
In addition to creating new relationships, Defined Relationships can be used to augment existing relationships. If you'd like to customize the way Simple Separation gathers a user's Department beyond ServiceNow's default logic, simply create a Defined Relationship against the 'Department' field on the target record. Your Defined Relationship will override ServiceNow's default behavior.