Transform Map choice action
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
8 hours ago
I'm running transform map, In field map even if we keep choice action as 'Reject' , choices are getting created in ServiceNow instance.
The field is a reference type, and it's importing a value that doesn't exist in the referenced location. Ideally, it should throw an error, but it doesn't.
Please help me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
7 hours ago
Hi @SotaT ,
The “Choice Action” option in a Field Map is only relevant for choice fields, such as dropdown menus, and does not apply to reference fields. Because your field is a reference field, the “Choice Action” setting will not have any effect. ServiceNow manages reference field values using a different approach.
When importing data into a reference field (such as , , etc.), if the imported value does not match any existing record in the referenced table (for example, ), ServiceNow will create a new record in the referenced table, provided the reference field is not set as dependent on a dictionary constraint. This is managed by the “Create on demand” option in the dictionary entry for the reference field.
If you want to explicitly reject or log invalid references:
if (!gs.getUserID(importValue)) {
// Log or skip
ignore = true;
errorMessage = 'Invalid user reference: ' + importValue;
}
You can place this in the onBefore or onAfter script of the Transform Map.
If it is helpful, please hit the thumbs button please mark the answer as correct based on the impact!!
Kind Regards,
Shaik Mohammed Mustaq
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
with Choice Action = Reject it should not create a new record in the referenced table
Share screenshots of your field map and also any transform script is there
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
