Reference field value is coming but which is not visible
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2023 06:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2023 08:14 PM - edited ‎08-06-2023 03:25 PM
From your provided scripted REST API code, it seems that you are successfully creating a new Request and RITM (Requested Item) in ServiceNow using the API. However, you are facing an issue with the reference field values (e.g., company, department) not being visible on the Req and RITM forms.
To make the reference field values visible on the Req and RITM forms, you need to ensure that the reference fields are correctly configured to display the values you are setting through the scripted REST API.
Here are some steps to check and verify:
Field Visibility: Make sure that the reference fields (e.g., company, department) are visible on the forms for both the Request (REQ) and Requested Item (RITM) records. You can check this by going to the form layouts and ensuring that the fields are not marked as hidden or read-only.
Field Permissions: Check the field-level permissions for the reference fields. Ensure that the user role you are using to create the Request and RITM through the API has the necessary read and write permissions for these fields.
Form Conditions: Sometimes, form conditions or business rules might be in place that affect the visibility of certain fields based on specific conditions. Review any form conditions or business rules related to the reference fields and ensure they are not preventing the fields from being displayed.
Catalog Item Configuration: Verify the catalog item configuration for the "New Hire/Transfer" item (based on the name you provided in the script). Ensure that the reference fields (company, department) are correctly mapped to the corresponding variables in the catalog item configuration.
Scripted REST API Execution Context: Ensure that the user role executing the scripted REST API has the necessary permissions to interact with the referenced tables (e.g., 'sc_cat_item', 'company', 'department').
If you have checked and confirmed that the above aspects are correctly configured, the reference field values should be visible on the REQ and RITM forms when you create a new Request through the API.
If you are still facing issues, you might consider checking the system logs and debugging the script execution to identify any potential errors or issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2023 09:24 PM
Hi @Mani60,
Make sure that record is active and at least 1 column with display value as true in reference table.
Also, Take a look at these articles or old threads. might be helpful.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0693859
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0785309
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2023 09:54 PM
Hi @Sagar Pagar Thanks for replying
I'm facing these issue When I create ticket through postman then the value of reference field is not visible.
please find the attached snapshot
Please help me how can I get these fields values visible.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2023 11:17 PM
Hi @Mani60,
have you checked the display value for referenced tables? Company and Department?
Make sure that you do have the correct Department and Company sys_id's in
Department: request.body.data.company
Company: request.body.data.existing_department
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2023 12:17 AM - edited ‎08-07-2023 12:17 AM
Hi @Sagar Pagar
When I take sys_id, at that time the Company and department's values are visible, but when I try to take the Name of the company and department at that time the value is not visible.
Here i don't need via sys_id here i need via name