Choice action field for Field Map record in Transform Maps


In this installment of the NOW You Know series, we’ll explore a deceptively simple aspect of importing data through transform maps: the Choice action field. Despite its seemingly straightforward nature, this field plays an incredibly important role in maintaining data integrity, especially when dealing with reference fields. Misuse of the Choice action field can lead to unexpected data issues, making it necessary to understand its proper configuration.

When bringing data into ServiceNow through a transform map there is one field on the Field Map record that can cause a lot of data issues if not used correctly: the Choice action field.

At first glance, the Choice action field looks simple. Only three choices exist in the dropdown: ‘create’, ‘ignore’ and ‘reject’. It defaults to ‘create’ and is hidden from the Field Map form for most target field types.

Where there can be issues is when the field you are writing your incoming data into is a reference field type. Reference fields in ServiceNow help users display data from another record on a form. They do not hold a text value in the database, but instead contain the unique identifier (sys_id) of the record that is referenced.

Background

How the import functionality handles reference fields is by trying to match the value passed from the Source field on the Field Map record to the display name of the referenced record. (This can be configured to use another field on the referenced record to match by adding that field name in the Referenced value field name field on the Field map record.)

Example

For example, if you are trying to fill in a user’s Department from an import, the system looks at the department value from the Source field on the Field Map record and tries to match it with the Name field on the Department table. If a user has a value of ‘Legal’ coming from the imported data feed and there is a department record with a name of ‘Legal,’ that department record will now be displayed as the value in the user’s department field. Where this gets tricky is if there isn’t a department record with the name of ‘Legal’. That is where the choice action value on the field map record comes in.

Choice action values

Create

If the Choice action field is set as ‘create’, this will create a new record on the Department table and associate that to the user. This can cause issues if you have another import that is bringing in Department values. By leaving this Choice action field at ‘create’ you could potentially have two sources creating conflicting records on your Department table. It is recommended if you have a separate import to the referenced table (in this example the Department table) you not choose ‘create’ as an option.

Ignore

In the above scenario, if you have a separate Department import, you would want to choose another option for the Choice action field: ‘ignore’. Choosing ‘ignore’ will allow the import to search for the value on the Department table, but if the query doesn’t find a Department value that matches the import, it will ignore the Department field in the import and leave the user’s department value as blank.

Reject

The third option for the Choice action field value is ‘reject’. If ‘reject’ is used in the above scenario and the import doesn’t find a matching Department record with the value of ‘Legal’, it will reject the row altogether. This would prevent the User record from being inserted or updated. This could lead to users missing from the system.

Understanding the Choice action field in ServiceNow’s transform maps is crucial for maintaining data integrity, especially when working with reference fields. The options—‘create,’ ‘ignore,’ and ‘reject’—each have specific implications that can affect how data is imported and displayed. Misconfiguration can lead to duplicate records, missing data, or failed imports. By carefully selecting the appropriate choice action, you’ll make sure your data is imported correctly, minimizing potential issues and maintaining a reliable database.

Additional resources

For more information on import sets in ServiceNow, review the documentation at https://docs.servicenow.com/bundle/orlando-platform-administration/page/administer/import-sets/concept/c_ImportDataUsingImportSets.html

While the above technical tip has been provided with care and consideration, it’s important to acknowledge that individual circumstances may vary. Always ensure compatibility and feasibility within your specific ServiceNow environment before implementing any suggestions. Additionally, back up your data and proceed with caution when making any changes to your instance or workflows. 

As with any change in ServiceNow, make sure you test any changes prior to moving to production.