Autopopulate a field on the incident form from the user table

DEESN
Tera Contributor

I've watched countless YouTube videos, read numerous Community articles and still I cant seem to populate a field from the User table on the incident form based on the caller_id. I created a dictionary entry called T-ID and made it a reference and then created various scripts including Client scripts and script includes and cant seem to get it to work. I even tried to use the user's email in case we accidentally set up the dictionary entry wrong and I cant get that to populate either (this was previously configured for us). 

 

Trying to understand if I missed a step in the process. Any help would be appreciated! Here is a very rudimentary outline of what I did:

 

Step 1. Created a dictionary entry for T-ID (reference to the sys_user table)

Step 2: Added the field to the incident form 

Step 3: Created a client script (tried so many versions at this point that writing them out seems unreasonable) to pull caller_id (field name for us is contact) and return the T-ID (u_t_id)

Step 4: Create a Script Includes 

 

18 REPLIES 18

Danish Bhairag2
Tera Sage
Tera Sage

Hi @DEESN ,

 

Did u try the auto populate functionality in servicenow available from Utah version.

 

https://youtu.be/IMLdnF7ufOg?si=DcJVwMPAMYUqQD0Y

 

Thanks,

Danish

 

Hi Danish! I appreciate your response. I did do some research into this functionality, however, we are not using it for catalog items. 

Tai Vu
Kilo Patron
Kilo Patron

Hi @DEESN 

Can you provide some screenshot of what you've done so far?

This would help us better understand the challenges you are encountering.

 

Cheers,

Tai Vu

Ankur Bawiskar
Tera Patron
Tera Patron

@DEESN 

So you want to auto-populate this new field with the user present in called_id field on incident table?

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

DEESN
Tera Contributor

@Danish Bhairag2  Thank you for your suggestion! I did do some research on this, however, we are not using the catalog items currently and that video with other documentation I found didnt seem applicable.

 

@SanjivMeher 

I have the field on the incident form however, when even when I click the search function on the T-ID field only columns Name, first name, last name, and email appear. I dont know if this is an indication that the dictionary entry was set up incorrectly or if there is an issue with the background code or both. Ideally the T0ID would autopopulate onchange with the contact and wouldnt require any search functionality. 

DEESN_0-1704805941791.png

 

@Ankur Bawiskar @Tai Vu 

 

Here is the current scripting I have: (technicially we dont need email pulled, I was just trying this to see if T-ID was set up incorrectly but neither populate) 

 

Client Script

DEESN_1-1704806058569.png

 

Script Includes:

DEESN_2-1704806113005.png

 

 

Our developer is out on extended leave so my knowledge of both javascript and ServiceNow is limited. Im trying to learn as much as I can (without breaking anything) so any supporting explanations or supplemental documentation to better my learning and understanding is appreciated!