How to input values of fields inside Description of an incident?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 02:47 AM
I am filling up the values of fields while raising an incident and then I want to see few of those field values inside description of an incident form.
Please assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 09:00 AM
Yes, this is a common issue in ServiceNow when referencing fields from another table. The sys_id is the unique identifier for each record in a table. When you see a sys_id instead of a display value, it's because ServiceNow is showing the actual value stored in the database, not the display value. Here are the steps to resolve this issue: 1. Navigate to the form where you are seeing the sys_id. 2. Right-click on the form header and select "Configure -> Form Layout". 3. In the Form Layout, find the field that is showing the sys_id. 4. Check the "Display Value" checkbox for that field. This will tell ServiceNow to show the display value of the field instead of the sys_id. 5. Click "Save". If the above steps do not work, you can use a script to get the display value. Here is a sample script: javascript var gr = new GlideRecord('table_name'); if (gr.get('sys_id')) { var displayValue = gr.getDisplayValue('field_name'); gs.info(displayValue); } Replace 'table_name' with the name of your table, 'sys_id' with the sys_id of the record, and 'field_name' with the name of the field that is showing the sys_id. This script will print the display value of the field to the system log. Remember to replace the placeholders with your actual table name, sys_id, and field name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 09:01 AM
Hi,
This can be achieved by creating an after update business rule on the incident table to add the required fields to description field.
For Example:
current.description = current.description + "\n" + "Caller: " + current.caller_id + "\n" + "State: " + current.state;
current.update();
Just changing the fields mentioned with the required fields should do it.
If you found this helpful, please mark this reply as solution.
Regards,
Manik Modi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2024 09:08 AM
Here's a summary of the steps you provided: 1. Create an after update business rule on the incident table. 2. Add the required fields to the description field using the following code: current.description = current.description + "\n" + "Caller: " + current.caller_id + "\n" + "State: " + current.state; current.update(); 3. Replace the fields in the code with the required fields. 4. Mark the reply as a solution if it was helpful.