How do use REST API to submit requested item, and display all variable fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2022 12:13 PM
I have a script to create a requested item via the REST API, and it does successfully create the request. However, when viewing the request, not all variable fields are displayed that were passed through from the API call.
The catalog item itself has drop down fields with UI policies applied, where if certain values are chose, different fields are hidden/made visible.
My question is, how do I force the API call to ignore UI policies and simply display the fields we are sending in the variables json?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2022 12:42 PM
Hi, so you might have this on your UI Policies:
This forces the UI policy on the record. If you do not wish that behaviour, you can uncheck the "applies on the target record". Of course, be aware that it will also apply to your non-api generated items.
Best regards,
Sebastian Laursen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-15-2022 04:17 AM
Thanks, that is helpful. I was able to toggle some of the UI policies to get the fields to display.
Would there be any way to have the policies respected when submitting a request via the API?
I'm currently using the order_now service catalog API - Service Catalog API | ServiceNow Developers.