How to use REST API sysparm_query to filter on FKs

CPU
Tera Contributor

Hello, I am trying to get all Business Apps with a specified owner.

 

The URL I am trying is 

 

 

https://<intance>/api/now/table/cmdb_ci_business_app?sysparm_fields=name,owned_by&sysparm_query=owned_by=86826bf03710200044e0bfc8bcbe5d79

 

 

I have 3 applications in the system, one with this owner (result of the same query without sys_parm):

 

 

{
    "result": [
        {
            "name": "App1",
            "owned_by": ""
        },
        {
            "name": "App2",
            "owned_by": {
                "link": "https://dev194063.service-now.com/api/now/table/sys_user/86826bf03710200044e0bfc8bcbe5d79",
                "value": "86826bf03710200044e0bfc8bcbe5d79"
            }
        },
        {
            "name": "App3",
            "owned_by": ""
        }
    ]
}

 

 

But if I execute the REST Get, I get zero results.

What is the correct syntax?

P.S. for non-FK columns all works perfectly. I can filter for name or any other string, enum, date, columns.

0 REPLIES 0