Build a CMDB query using the CMDB Query Builder
-
- UpdatedAug 1, 2024
- 7 minutes to read
- Xanadu
- Configuration Management
A CMDB query type that queries the infrastructure for CI classes and optionally non-CMDB tables, and the relationships and references that connect them.
Before you begin
Role required: cmdb_query_builder_read to only view and run saved queries, and cmdb_query_builder (contained for itil, itil_admin, and asset) to create and save queries, modify saved queries, and run queries. For reporting on queries, report related ACLs are required.
Authorized users can update and delete a query created by another user.
About this task
Build the query by dragging the CI classes and non-CMDB tables that you want to include in the query. Then dropping them as nodes on the canvas, and defining relationship properties between them. You can filter on the attributes of any node to narrow down the results to a specific set of CIs of that class or to a single specific CI. You can also select which property columns appear in the query results.
As you step through building a query, list options and other user interface elements of the CMDB Query Builder, are dynamically filtered as appropriate to your selections.
To learn more about using Query Builder, see the CMDB Query Builder Queries and Reporting - Platform Analytics Academy ServiceNow Community video. For a step-by-step walk through of building CMDB queries in the Query Builder, including queries with application services, see Example queries.
Procedure
What to do next
Select Run.
Only the first 100 results of the query appear in the results pane.- Select Load More Results to view the next set of 100 results.
- Select Load All Results to view the rest of the query results, up to the number specified by the glide.cmdb.query.max_results_limit system property (10,000 by default).
Select a CI to open its CI form, and on the CI form select Open in CMDB Workspace to view CI health in the CI Health tile in CMDB Workspace. This operation requires the sn_cmdb_user (CMDB user) role.
Note:- Ensure that the glide.security.use_csrf_token property is set to true, allowing all results to appear.
- When Level is set to Up to 2nd level relationships, the relationship type does not appear in the query results.
- When a query is running, wait for it to complete or to time out before opening or running another query.
- Modify Query Builder settings: Select the
(Settings) icon to open the Query Builder Settings dialog box.
- Copy and share the URL of a saved query with users that have access to the CMDB Query Builder. Pasting the shared URL in a new internet browser window, directly opens the saved query in the CMDB Query Builder.
- Create a report in CMDB Query Builder.
- Create a schedule to run the query at a future time, and to email the results to interested parties.
- Export query results:
Select the Query Results context menu and select Export. Even if the Load More Results button is visible, indicating that there are additional query results, only the results that are visible are exported.
- Export and import a CMDB query to port a query definition between instances.
- Populate a CMDB group using a saved query.
- Delete a CMDB query.
Related Content
- Example queries
Use the example queries as models for building your custom CMDB queries and Service Mapping queries.