Lookup fields vs Reference fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2018 10:50 PM
Hi,
What does a lookup field type represent? what is the difference between lookup and reference fields?
Thanks.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2018 10:56 PM
I'm assuming you're talking about a Lookup select box; they give you the ability to create a choice list using data form a table just like a reference field, but you can specify what value is stored upon selection, etc.
I'm not going to re-iterate what the docs sites say, so here you go for more info:
https://docs.servicenow.com/bundle/london-it-service-management/page/product/service-catalog-management/reference/r_VariableTypes.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2018 11:10 PM
Hi,
Reference Field
A reference field stores a reference to a field on another table. For example, the Caller field on the Incident table is a reference to the User [sys_user] table. ... Each reference field stores a sys_id for each referenced record in the database, but the sys_id is not shown
A reference field can refer only to records from one other table. To add a field that can refer to records on any table, use the Document ID element type.
Lookup
On forms, the reference lookup icon (
) appears by editable reference fields. Clicking the reference lookup icon displays a list of records on the referenced table.
A lookup select box variable is more powerful than a reference variable.
Specify the following when creating a lookup select box variable:
- Lookup from table: the table from which values are queried.
- Lookup value field: the field on the lookup table whose value is used as the variable's value (typically sys_id).
- Lookup label field(s): a comma-separated list of fields on the lookup table whose values are used to display the selections in the select box. For example,manufacturer,name for the Software [cmdb_ci_spkg] table would display selections as:
- Microsoft | Excel
- Adobe | Photoshop Elements
- Lookup price field: the field whose value is used to modify the price of the item being ordered.
- Lookup recurring price field: the field whose value is used to modify the recurring price of the item being ordered.
Thanks,
Ravi
