Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

REST Table API Catalog Task

Nanasaheb
Kilo Contributor

I am using Table REST API to fetch the task numbers, currently i am able to fetch tasks by applying two conditions that is #Assignment_Group and #State. Now I want to fetch data for fetching data based on 3 conditions (Assign group, state and #Item). i tried to do but  no luck. 

"XXXX/api/now/table/sc_task?sysparm_query=" \
"assignment_group%3Db045df67db2dc010a05b298a48961yh6%5Estate%3C3&" \
"sysparm_display_value=true&" \
"sysparm_exclude_reference_link=true&" \
"sysparm_fields=number"
Above link is working for me.

Attaching SS which contains all details about fields.
in attached image i want to apply filter on Assignment Group, State and Item field at a time.

If anyone know how to use conditions then please help to sort out.


Thank You!

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

give query as below

XXXX/api/now/table/sc_task?sysparm_query=" \
       "assignment_group%3Db045df67db2dc010a05b298a48961yh6%5Estate%3D3%5Erequest_item.item%3D<itemSysId>"

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

6 REPLIES 6

Mohit Kaushik
Mega Sage
Mega Sage

Hi Nanasaheb,

try adding the below query in the api  end point and let me know.

"XXXX/api/now/table/sc_task?sysparm_query=" \
"assignment_group%3Db045df67db2dc010a05b298a48961yh6%5Estate%3C3%5Eparent.cat_item%3D<sys_id of catalog item>"

 

Please mark this answer correct if it resolved the query and mark it helpful too if it helped you at all

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Hi NanaSaheb,

 

Did you try the above code?

 

Thanks,

Mohit 

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)