Location field is not populating any data in the Incident.

Karthick PS
Tera Contributor

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.

 

KarthickPS_0-1668257607483.png

2 REPLIES 2

AnubhavRitolia
Mega Sage
Mega Sage

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.

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023

Mike_R
Kilo Patron
Kilo Patron

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;