Attribute Mapping references
Summarize
Summary of Attribute Mapping references
Attribute Mapping in ServiceNow enables you to align external resource attributes from a SCIM Provider with ServiceNow table fields. This mapping acts as a single source of truth for synchronizing user and resource data between systems.
Show less
Key Features
- Attribute and Sub-Attribute: Define the main attribute (e.g.,
userName) and, if applicable, a sub-attribute for complex types (e.g.,name.familyName). Simple attributes have no sub-attribute. - Filter Condition: For multi-valued attributes with different types (such as
phoneNumbers), specify filter conditions (e.g.,type eq "mobile") to select the relevant attribute value. - Database Field Name: Map the SCIM attribute to a specific ServiceNow database field, including dot-walking for related fields (e.g., mapping
departmentattribute to the Department Name on the User table). - Default Value: Configure a fallback value to send to the SCIM Provider when the direct attribute mapping returns null, or use a hard-coded value when needed. In such cases, database table and field names should be set to None.
- Script: Use scripting to fetch or transform attribute values when direct mapping is insufficient. Scripts must return a string or a stringified JSON formatted as expected by the provider. Both simple and multi-valued attribute scripts are supported.
Practical Application for ServiceNow Customers
By leveraging Attribute Mapping, you can accurately synchronize user and resource data from external SCIM Providers into ServiceNow tables, ensuring consistency and integrity of data. The ability to use filters, default values, and scripts allows for flexible and precise control over how attributes are translated and populated in your system. This capability is essential for automating user provisioning and maintaining up-to-date records in ServiceNow aligned with external identity sources.
The attribute mappings enables you to use the attributes as a single source of resource to the ServiceNow table fields.
Attribute
The attribute for which mapping needs to be defined. For example, userName.
Sub-Attribute
Select the sub-attribute, if any, for which a mapping needs to be defined.
For example, if there is a complex type attribute like name.familyName, then the attribute is name and the sub-attribute is familyName.
For simple attributes like user name, the Sub-Attribute value would be None.
Filter Condition
A multi-valued attribute can have additional information that can be specified by using a Filter Condition. The choices for the filter condition are populated using the schemas defined by the SCIM Provider.
For example, the phoneNumbers attribute has multiple types like work, mobile, home, and so on.
You can specify a Filter Condition from a set of possible values. For example, the phoneNumber attribute can have the Filter Condition as type eq "mobile".
The phoneNumber attribute can instead have a Filter Condition as type eq "work".
Database Field Name
If the direct attribute mapping option is chosen, then this attribute needs to be defined. The Database Field Name field represents the ServiceNow field name that is mapped with the SCIM Attribute.
For example, the username SCIM Attribute can be mapped to a user as the Database Table Name field, and to the user ID field as the Database Field Name field.
You can also dot-walk using the Database Field Name. For example, the department SCIM Attribute can be mapped to the Department Name field.
Here the Database Table is User and the Database field Name is Department Name.
Default Value
The default value is passed to the SCIM Provider if direct attribute mapping of that field returns null. The default value can also be used to return a hard-coded value.
In the case of a hard-coded value, the database table name and field name should be None.
For example, the primary sub-attribute value of work email can be hard coded as true.
Script
The script is used to fetch the attribute value. The return type of the script should be always a string, or a JSON converted as a string. The output of the script should be in the proper format as expected by the provider for that attribute.
The following is a sample script for a multi-valued attribute.
The output of the script should have a stringified JSON Array.
The following is a sample Script of a simple-valued Attribute.
The output of the script should be a string.