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.

Using Query on Reference Field using ServiceNow Connector in CoPilot Studio

mayurtandon
Kilo Contributor

Hi All,

 

I am currently working with the Microsoft Copilot ServiceNow connector to retrieve data from ServiceNow. Specifically, I am using the “List records” method to fetch data from the Business Application table (cmdb_ci_business_app). However, I am encountering a challenge when querying on reference fields, i.e., fields that store sys_id values from other tables.

 

For example, I need to find business applications where the application category is “Manufacture” or where the department is “SE DC.” These values are stored as sys_id references in the Business Application table, pointing to entries in the Application Category or Department tables.

 

Below is a screenshot illustrating my query to find applications where the application category is “Manufacture.” I have tried the following queries:

  • application_category=manufacture
  • application_categoryLIKEmanufacture

Both of these queries return null values.

mayurtandon_0-1743762129323.png

 

However, when I pass the 32-character sys_id instead of the value “Manufacture,” such as application_category=c6XXXXXX1b245d104XXXXXX5bbXXXbae, I get the expected results.

mayurtandon_1-1743762481585.png

 

So far, we have attempted a workaround where we first query the referenced table to get the sys_id for the desired value and then use that sys_id in the Business Application table query. While this approach works, it is not feasible when we need to filter based on multiple parameters simultaneously.

 

Can anyone provide guidance or a solution for querying reference fields directly by their display values rather than sys_ids? Any help would be greatly appreciated.

 

Thanks in advance!

0 REPLIES 0