REST API for Catalog Items

Arun91
Tera Contributor

Hi Team,

I am using REST API to submit the service request. In catalog item form we have variable called name and it  is reference type. 

When I am sending the information in REST API for reference field i am using sys_id. Instead of sys_id is it possible to put the display value of the user to submit it. If I am using display value record is created but the field value is empty. 

Any one help me on this.

 

2 REPLIES 2

Ratnakar7
Mega Sage
Mega Sage

Hi @Arun91 ,

 

When working with reference fields in ServiceNow via REST API, you have the option to submit either the sys_id or the display value of the referenced record. However, there are some considerations to keep in mind:

  1. Using sys_id: Submitting the sys_id of the referenced record is the most common approach. This ensures that the reference field is properly populated with the correct record in the ServiceNow instance.

  2. Using Display Value: While it's possible to submit the display value of the referenced record, there are limitations. ServiceNow may not always be able to correctly identify the referenced record based solely on the display value, especially if there are multiple records with the same display value. Additionally, if the display value changes in the future, it could cause issues with data consistency.

However, keep in mind the potential limitations and risks associated with using display values instead of sys_ids. It's generally recommended to use sys_ids for reference fields to ensure data integrity and consistency. If you must use display values, ensure they are unique and unlikely to change in the future.

 

Thanks,

Ratnakar

Arun91
Tera Contributor

When i am providing the display name, record is getting created but reference field is empty in the ticket