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.
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.
Learn how Pathways Consulting Group can work for you
Connect with a ServiceNow Expert
Contact Us
servicenow transform map choice action, choice action in transform map servicenow, choice action in transform map, servicenow field map, servicenow field map choice action
Understanding the 'Choice Action' Field
The 'Choice Action' field in ServiceNow's Transform Maps is a crucial setting that determines how data is handled during the import process. This field offers three options: 'create', 'ignore', and 'reject', each with its own implications for how the system will process the incoming data.
Selecting the appropriate 'Choice Action' setting is essential to ensure accurate and reliable data importation, minimizing potential issues and maintaining a well-structured database. Understanding the nuances of each option will help you make informed decisions and optimize your data transformation workflows.
Leveraging the 'Create' Option
When the 'Choice Action' field is set to 'create', the system will automatically generate a new record in the target table if a matching value is not found. This can be particularly useful when importing data from external sources, allowing you to populate your ServiceNow instance with new information without manual intervention.
However, it's important to exercise caution when using the 'create' option, as it can lead to duplicate data or unintended consequences if not properly configured. Carefully review your data sources and mapping to ensure that the 'create' action is applied only in appropriate scenarios.
Handling Unmatched Data with 'Ignore'
The 'ignore' option in the 'Choice Action' field is useful when you want the system to skip over records that do not have a matching value in the target table. This can be beneficial when you have a separate import process for certain data types, such as departments or locations, and you want to avoid overwriting existing information.
By selecting 'ignore', the system will attempt to find a match, but if no match is found, it will leave the corresponding field in the target record blank, rather than rejecting the entire row or creating a new record.
The 'Reject' Option for Undesirable Data
In some cases, you may want to completely reject rows of data that do not have a matching value in the target table. The 'reject' option in the 'Choice Action' field allows you to do just that, preventing the import of potentially problematic or irrelevant data.
Using the 'reject' option can help maintain data integrity and ensure that only valid and relevant information is imported into your ServiceNow instance. However, it's important to carefully consider the potential impact of rejecting data, as it may result in incomplete or missing information in your system.
servicenow transform map choice action, choice action in transform map servicenow, choice action in transform map, servicenow field map, servicenow field map choice action
Understanding the 'Choice Action' Field
The 'Choice Action' field in ServiceNow's Transform Maps is a crucial setting that determines how data is handled during the import process. This field offers three options: 'create', 'ignore', and 'reject', each with its own implications for how the system will process the incoming data.
Selecting the appropriate 'Choice Action' setting is essential to ensure accurate and reliable data importation, minimizing potential issues and maintaining a well-structured database. Understanding the nuances of each option will help you make informed decisions and optimize your data transformation workflows.
Leveraging the 'Create' Option
When the 'Choice Action' field is set to 'create', the system will automatically generate a new record in the target table if a matching value is not found. This can be particularly useful when importing data from external sources, allowing you to populate your ServiceNow instance with new information without manual intervention.
However, it's important to exercise caution when using the 'create' option, as it can lead to duplicate data or unintended consequences if not properly configured. Carefully review your data sources and mapping to ensure that the 'create' action is applied only in appropriate scenarios.
Handling Unmatched Data with 'Ignore'
The 'ignore' option in the 'Choice Action' field is useful when you want the system to skip over records that do not have a matching value in the target table. This can be beneficial when you have a separate import process for certain data types, such as departments or locations, and you want to avoid overwriting existing information.
By selecting 'ignore', the system will attempt to find a match, but if no match is found, it will leave the corresponding field in the target record blank, rather than rejecting the entire row or creating a new record.
The 'Reject' Option for Undesirable Data
In some cases, you may want to completely reject rows of data that do not have a matching value in the target table. The 'reject' option in the 'Choice Action' field allows you to do just that, preventing the import of potentially problematic or irrelevant data.
Using the 'reject' option can help maintain data integrity and ensure that only valid and relevant information is imported into your ServiceNow instance. However, it's important to carefully consider the potential impact of rejecting data, as it may result in incomplete or missing information in your system.