CSM Query Rules

  • Release version: Australia
  • Updated March 12, 2026
  • 1 minute to read
  • Query rules are used to filter the records in CSM-related tables that are accessible by users with CSM roles. These filters, which are applied in query business rules and READ ACLs on CSM-related tables, are stored in a metadata table.

    Starting with the London release, query rules and filters were defined in the CSQueryBRUtilOOBConstants script include. In the Quebec release, these filters have been moved to the Query Rule (sn_query_rule) table.

    This change applies to Query business rules (QBRs) and read ACLs on CSM-related tables. Each data table that used QBRs prior to Quebec now has a new QBR that uses the new logic. Tables with read ACLs that used filters from the CSQueryBRUtilOOBConstants script include now have one more read ACL that uses the filters from the Query Rule table.

    As a user with the sn_queryrules.admin role, you can create, update, view and delete a query rule. As a user with the role, you can view the query rules table.

    Availability

    The CSM query filters feature is active on zBoot instances. Existing customers must contact ServiceNow Customer Support to enable this feature.

    Query rules property

    The sn_cs_queryrules.use_query_rules property determines whether to use the Query Rule table or the CSQueryBRUtilOOBConstants script include. This property is set to true for zBoot instances and false for upgraded instances.
    • If true, the instance uses rules and filters from the Query Rule table to determine read access to the CSM tables for the logged-in user.
    • If false, the instance uses rules and filters from the CSQueryBRUtilOOBConstants and its extensions to determine read access to the CSM tables for the logged-in user.

    Query Rule table

    The Query Rule (sn_query_rule) table extends the sys_metadata table and stores filters for the following tables:
    • Case (sn_customerservice_case)
    • Affected Install Bases (sn_install_base_m2m_affected_install_base)
    • Install Base Items (sn_install_base_item)
    • Installed Products (sn_install_base_m2m_installed_product)
    • Sold Products (sn_install_base_sold_product)
    • Order Case (csm_order_case)
    • Sold Product Covered (sn_install_base_m2m_contract_sold_product)
    • Orders (csm_order)
    • Asset (alm_asset)
    • Entitlement (service_entitlement)
    • Account (customer_account)
    • Work Order (wm_order)
    • Contact (customer_contact)
    • Contract (ast_contract)