help needed for api call

chercm
Mega Sage

hi 

 

i have a field called u_imapcted_asset but when i put into the Rest API i am not getting any result . not understanding why

 

image.png

 

image.png

14 REPLIES 14

Joni V B
Tera Guru

Hi @chercm ,

 

You have a typo in your field name (dictionary is u_imAPcted_asset) and you are missing an operator in your query.
An easy way to get an encoded query is by navigating to the list view, forming your filter and then right clicking on the filter breadcrumb and select 'Copy Query'.

Runjay Patel
Giga Sage

Hi @chercm ,

 

Query  parameter is wrong, Impacted asset field is list type so it will accept sys_id like below.

u_impacted_assetLIKEd64b9bd783095210a9589780deaad3c6.

 

LIKE means contain here.

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @chercm,

 

The easiest way is go to incident table and get the encoded query from the filter and paste it here. I guess you have put the query manually. 

 

I hope it helps..


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Anand Kumar P
Giga Patron
Giga Patron

Hi @chercm ,

 

sysparm_query= u_impacted_asset=00aba08d3790200044e0bfc8bcbe5dfc

From incident list view open your designated asset record then right click and copy query.

 

Mark it as helpful and solution proposed if it serves your purpose.
Thanks,
Anand