Autopopulate a field on the incident form from the user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 12:38 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 08:38 PM
Hi @DEESN ,
Did u try the auto populate functionality in servicenow available from Utah version.
https://youtu.be/IMLdnF7ufOg?si=DcJVwMPAMYUqQD0Y
Thanks,
Danish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 04:51 AM
Hi Danish! I appreciate your response. I did do some research into this functionality, however, we are not using it for catalog items.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 08:41 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2024 08:51 PM
So you want to auto-populate this new field with the user present in called_id field on incident table?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-09-2024 05:18 AM
@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.
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.
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
Script Includes:
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!