sysparm_view not returning expected response in REST API

Mahesh120
Tera Expert

Hi team,

Started working with REST API and trying to retrive some data from Event table using encoded query along with custom view.

Encoded query worked fine and got the response.Howver when I include the custom view then also it returned whole columns.

UI view has section and has certain elements in it but not returning expected response.

Below is the syntax i have used

https://instance.service-now.com/api/now/table/u_event?sysparm_query=active=true^short_descriptionLI...

Am i missing anything here or any syntax change required?

Appreciate any guidance here.

Regards,

Mahesh.

4 REPLIES 4

epam
Kilo Guru

It worked like a charm.Curious to know the reason for that.



Regards,


Mahesh.


I got that.Thanks for the quick tip.


Mahesh120
Tera Expert

Hi All,



Is there a way I can share the API without exposing the actual query?



Example:



AlertsQuery: sysparm_query=active=true^short_descriptionLIKEAlert&sysparm_view=nameofview



https://instance.service-now.com/api/now/table/u_event?AlertsQuery



I though of using dynamic filter and they work only on reference fields.Any thoughts on this?



Regards,


Mahesh.