Can we pass display value for reference variable while submitting request via OOB API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2022 11:13 PM
Currently while submitting the service catalog request using OOB API, When I am passing the sys_id in Reference type of variable the value is taking in the requst as expected.
But if we pass the display value reference field is taking as empty, is there a way we can use Display value in Reference type of variable while submitting the Service Catalog Request via SR OOb API?
API: /api/sn_sc/servicecatalog/items/{sys_id}/order_now
Example: If I like to select a user in reference filed which referred to User table. Is there a way I can pass the user id or Display name instead of user sys_id while ordering the catalog item similar to table APIs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2022 06:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2022 07:04 AM
should work when you include this parameter in the URL i.e. REST endpoint.
sysparm_display_value=true
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2022 07:09 AM
Thank you for quick response,
But my doubte is, Is there a way we can pass Display name as variable value in Payload for reference fields?
Currently it only accepting sys_id.
Example:
Currently this is working -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2022 07:59 PM
I already told it's possible.
just include the sysparm_display=true in query parameter when you hit the endpoint
screenshot I already shared
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2022 10:17 PM
Tried that but value not inserting even after using "sysparm_display_value=true"
Request created but user reference value not get inserted
Could you please suggest any other approach or am I doing it wrongly..
Regards,
Kumar