- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 04:59 AM
Hi,
There is reference field which refers an application table which contains value as 'ABC XYZ'. So when a user selects a value from that field, the reference field should display value as 'ABC'. It should display values without 'XYZ' keyword.
Is it possible to achieve?
Thanks in advance!
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 05:28 AM
No you cannot change the display value of the reference field apart from the fields which are present in your base table. So if you want to display something else then you might have to create a custom field in your table and populate the value of first half of the application there via some script and then set the display value of the custom field to true.
Post this you when you will select the same filed as reference in your catalog item then it will show only ABC.
Below thread might provide you more clarity on the same. Read the answer provided by Pradeep Sharma.
https://community.servicenow.com/community?id=community_question&sys_id=6535afb9dbf567005d782183ca961978
Please mark this answer as correct and helpful.
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 05:13 AM
Hi There,
Reference field display you might not be able to change it. But you can create a new field and populate the value the desired value there.
For ex: You can write an onchange Catalog client script for this.
var ref = g_form.getDisplayBox('your reference field name').value;
g_form.setValue('new field name',ref.split(' ')[0]);
Please mark this correct and helpful as per impact.
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 05:17 AM
Hi Mohit,
We want to display the value in the reference field itself. We do not want to populate it in another field. Can't we display it in the same field?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2022 05:28 AM
No you cannot change the display value of the reference field apart from the fields which are present in your base table. So if you want to display something else then you might have to create a custom field in your table and populate the value of first half of the application there via some script and then set the display value of the custom field to true.
Post this you when you will select the same filed as reference in your catalog item then it will show only ABC.
Below thread might provide you more clarity on the same. Read the answer provided by Pradeep Sharma.
https://community.servicenow.com/community?id=community_question&sys_id=6535afb9dbf567005d782183ca961978
Please mark this answer as correct and helpful.
Thanks,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2022 03:30 AM
Thanks Mohit! We tried this approach and it working fine.