Several reference fields to same table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 09:08 AM
Hello all,
I want to have several reference fields in a table. They all reference the same table but i want them to get different fields in the reference table.
For instance, i want a field that gets the username and another field that gets the email, both from the sys_user table.
How can this be done?
When i set a reference field it always returns the same field
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 09:29 AM
Reference field will show the field value which is set as display in that referenced table.
You can make a field as reference and populate rest fields value using script.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2017 10:08 AM
Hi Antonio. Only one reference field is needed in order to link the record on your table to the sys_user table, and as Deepak mentioned that always shows whichever field that has the "display" attribute = true.
http://wiki.servicenow.com/index.php?title=Reference_Fields#Selecting_the_Display_Value
That said, once linked you can add as many sys_user fields to your form/list as you want using dot-walking. Note, though, it's way easier to use the legacy Form Layout tool than the newer Form Designer for this.
http://wiki.servicenow.com/index.php?title=Dot-Walking#gsc.tab=0
http://wiki.servicenow.com/index.php?title=Configuring_Forms#gsc.tab=0
Regards,
Kevan