How do use REST API to submit requested item, and display all variable fields

Josh Demcher
Giga Contributor

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?

2 REPLIES 2

Sebastian L
Mega Sage

Hi, so you might have this on your UI Policies: find_real_file.png

 

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

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.