Location field is not populating any data in the Incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2022 04:56 AM
Hi,
We encounter an issue wherein one submitted incident (which was submitted from portal) does not show up the location data in it.
However, when you create a new incident that is showing the location data.
It's weird and wondering how a submitted incident not showing the location data. Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2022 07:42 AM
Hi @Karthick PS
Location field is made mandatory at form level. If you try to create incident from form, it will not let you submit without filling mandatory fields.
But when you try to create record from service side like Server side script or Record Producer etc, it will create without considering mandatory field on form level.
It is the duty of the team to check that we are populating mandatory field from backend also when creating any record on any table.
If you are submitting record producer through portal, you have to right script on Record Producer to auto populate Location and other mandatory fields also based on your requirement same as on form level to keep it consistent.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2022 08:19 AM
When you submit through the platform UI, there's a client script called "(BP) Set Location to User". This auto populates the location field whenever you select a user.
instanceName.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=5e524025c0a80166004d1761e85e2058
If you are creating via Record Producer, this client script will not run. So in your record producer, you should add a line of code to set the location. Such as
current.location = producer.userVariableName.location;