Use string filters in REST API queries

srihari3
Kilo Contributor

Hi,

I am trying to filter the responses for REST query

`https://XXXX.service-now.com/api/now/table/sys_db_object?sysparam_query=sys_nameLIKEDia`

I read that the sysparm_query=column_aISNOTEMPTY would work. As documented in How do I filter empty rows with REST API?   I am trying to filter on sysparam_query=sys_nameLIKEDia and failed.

Could anyone point me to the flaw and help me filter the response on string columns.

Thank you

1 ACCEPTED SOLUTION

Alikutty A
Tera Sage

Hi,



Just add the following line in your sysparm_query



nameLIKEia



I think sys_name is not a field name?



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


View solution in original post

5 REPLIES 5

Alikutty A
Tera Sage

Hi,



Just add the following line in your sysparm_query



nameLIKEia



I think sys_name is not a field name?



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Here is a sample screenshot from REST API Explorer


find_real_file.png




Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


I wanted to filter the `sys_name` attribute not the `name`. But it seems that I can do string querries only on `name` but not `sys_name`. This answer is good enough for my needs.


Yes sys_name is not an actual field on the table which you are accessing (sys_db_object) and name is the correct field name.



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response