Validation on a choice and reference type of field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 02:43 AM
Hi ,
We have a choice field with choices INC,CRQ . But if the external system provides value as PKE ,field has got added with a new choice value PKE to the dictionary . . Same field is used in other form with different choices .How do i perform server side validation on such choice field to accept only the defined values .
Similarly for reference type of field , if the reference value doesnt exist in database ,it creates a new record with given value .How to perform validation for such case
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 02:50 AM
Hi,
How you are trying to add the values in it? Also to which table is the reference type is applied?
Thanks
Shashikant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 03:16 AM
In Transform map corresponding to mapping of this filed you need to select ignore in choice action.
https://docs.servicenow.com/bundle/kingston-platform-administration/page/script/server-scripting/task/t_CreatingAFieldMap.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2018 04:01 AM
Hi Gurpreet,
You should write a field script on the transform map and if you are writing it for choice field you need to get all the choices of that field from sys_choice table and validate it , same for reference field glide on the table to which it references and validate data. if not found then just return "" from that field .
You can refer below screenshots if you dont know were to write the field script.
Just open the field from the fieldMAP and write the script for validation in it.
Please mark as helpful if found helpful.
Regards,
Dhananjay.