Advanced Settings - Custom User Schema
You can use the Custom Devices schema and the Custom Users schema to add a JSON file that fetches information from one object to another, such as from a source or to enrich a device with information from a different object. You can add more than one JSON file.
Using Custom Schema Entries to Fetch Information from One Object to Another
The JSON file must be of the format:
{
"type": "link",
"link_type": "reverse_reference",
"source_table": "u_computer_users",
"source_field": "software",
"destination_table": "u_sn_cmdb_ci_class_configuration_item_has_users",
"linked_record_identifier": "u_user",
"link_to_field": "ax_local_accounts"
}- link_type - The only supported type is reference.
- source_table - The type of the source object type in ServiceNow. This is the table that will be enriched from the data in the destination_table.
- source_field - The attribute of the object type from which the values should be brought. Enrich the contents of the source_table which has the same name as the value of the source_field in the destination_table, with the contents of the destination_table field.
- destination_table - The destination object type in ServiceNow from which the data will be imported.
- linked_record_identifier - The name of the attribute that identifies the object.
All of the above are mandatory.
It is not necessary to list all of the source tables; instead of listing all source_tables, you can write “$ROOT” in the “source_table” field. For example, if the source table contains the field "owner", then the system fetches the object of the sort "user" for all of the tables. This will populate associated users for all source objects that have the field "owner".
[
{
"id": "35452789AI",
"type": "link",
"link_type": "reference",
"source_table": "$ROOT",
"destination_table": "sys_user",
"source_field": "u_user"
}
]When the original reference field contains multiple values, use csv_reference for the "link_type" field. In this case, the output will be an array of objects instead of a single object.
-
The expected input (raw field) needs to be a string of comma-separated ServiceNow identifiers (sys_id). For example:
"u_related_servers": "71c031213784200044e0bfc8bcbe5de1,46c12959a9fe1981009955ab1fa64226,6b43105c37301000deeabfc8bcbe5db2,2dfd7c8437201000deeabfc8bcbe5d56"
The JSON should be in this format:
[
{
"id": "17112500002",
"type": "link",
"link_type": "csv_reference",
"source_table": "$ROOT",
"source_field": "u_relate_servers",
"destination_table": "cmdb_ci",
"linked_record_identifier": "sys_id"
}
]The output is an array of objects: "u_related_servers": [{...},{...},{...}]
Updated 4 days ago
