- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2019 11:30 AM
I have two tables in ServiceNow that has company information and Contact information.
Company table:
Company Key |
Company name |
Company Address |
1 |
Example Company 1 |
123 Sample Drive, City, ST 12345 |
2 |
Example Company 2 |
124 Sample Drive, City, ST 12345 |
3 |
Example Company 3 |
125 Sample Drive, City, ST 12345 |
Contact/User Table:
Contact key |
Name |
Contact Address |
Company Key |
11 |
John Smith |
Xyz address |
2 |
12 |
Adam Abel |
Abc address |
3 |
13 |
Rice Rich |
Cde address |
1 |
14 |
Nick Jay |
Fgh address |
2 |
Question is, how can I have Company name returned on a Contact/User form instead of Company key?
I have Oracle DB administration background and this is approached differently as I have direct access to the DB, but not the case in ServiceNow. Any suggestions will greatly be appreciated.
Thanks,
EB
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2019 12:03 PM
Thanks,
I'm still on the initial loading of the data into ServiceNow. At this point that field is empty and I want it to load automatically from the transform.
I have solved this issue by adding this script to the transform map:
answer = (function transformEntry(source) {
var companyID = "";
// Get company record using manufacturer seq number
if(source.u_company_key){
var mfr = new GlideRecord("u_manufacturer");
mfr.addQuery("u_company_key", source.u_company_key);
mfr.query();
if(mfr.next()){
companyID = mfr.getValue('u_company_name');
}
}
return companyID;
})(source);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2019 08:48 AM
Navigate to company table and make display value true for Name field on company table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2019 12:39 PM
Hi EB,
I think you need to set the display field for your custom company table.
Do the following (my example is on the "incident" so substitute your custom table name)
- Application Navigator >> Type - <your_custom_table_name>.CONFIG i.e. incident.CONFIG >> Enter
- Select "Dictionary Entries" tab.
- In the list view find the 'name' dictionary entry and look for the corresponding 'display' column. Set "Display" to "true" for the Name column that you want to show on reference fields. Ensure all other dictionary entries have their "Display" value set to "false".
Your reference field should now show that columns display value as the display value for reference fields.
Let me know if this worked for you.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2019 09:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2019 10:50 AM
Check that you have only one field with display value set to true on that table, if not make them display=false except the u_company_name.
Let us know if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2019 11:15 AM