cityworks
    Preparing search index...

    Class Query

    Index

    Query

    • Build a query using query language syntax or by specifying a saved query ID

      Parameters

      • query: string | number

        Query to run (specify syntax or queryID)

      • options: {
            Page?: number;
            PageSize?: number;
            SortDescending?: boolean;
            SortField?: string;
            Variables?: DynamicVariableMap;
        } = {}

        Other options. See: /{subdirectory}/apidocs/#/service-info/General/Query

      • OptionaldomainId: number

        The domain ID of the domain to search, defaut is authenticated user's current domain

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects

    • Get a list of the saved queries the current user can access.

      Parameters

      • queryTypes: string[] = []

        Get the saved queries for a particular type, default is all types

      • createdOnly: boolean = false

        Get only queries created by the current user, default is get all queries current user can access

      • includeQuery: boolean = true

        Restrict GIS searches to specified entity types

      • OptionalvisibleToMobile: boolean

        Filter visibility to mobile. Default ignore visibility to mobile.

      • OptionaldomainId: number

        The domain ID of the domain to search, defaut is authenticated user's current domain

      Returns Promise<unknown>

      Returns Promise object that represents a collection of SavedQueries

    • Get schema for specified query type

      Parameters

      • queryType: string

        Specify Query Type

      • OptionaldomainId: number

        The domain ID of the domain to search, defaut is authenticated user's current domain. Used to determine query field configuration for the schema fields.

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects

    • Get available query types

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects

    • Get info about query types

      Parameters

      • includeDefaultSchemasInclude: boolean = true

        Include schemas (Work Order, Service Request, etc), default is true.

      • includeGisSchemas: boolean = true

        Include gis schemas, ddefault is true.

      • OptionaldomainId: number

        The domain ID of the domain to search, defaut is authenticated user's current domain

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects

    • Run a query using query language syntax

      Parameters

      • query: string

        Query syntax string or saved query ID to run. If you want to append addt'l query items to a saved query, add QueryValue in the options

      • options: {
            Page?: number;
            PageSize?: number;
            QueryValue?: string;
            ResponseFields?: any;
            SortDescending?: boolean;
            SortField?: string;
            Variables?: DynamicVariableMap;
        } = {}

        Other options. See: /{subdirectory}/apidocs/#/service-info/General/Query

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects

    • Validate a query string

      Parameters

      • query: string

        The query to validate

      • variables: DynamicVariableMap

        Required if the query includes variables

      • OptionaldomainId: number

        The domain ID of the domain to search, defaut is authenticated user's current domain

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects

    • Validate a query response definition

      Parameters

      • queryType: string

        The query to validate

      • responseDefinition: DynamicResponseDefinition

        Required if the query includes variables

      • OptionaldomainId: number

        The domain ID of the domain to search, defaut is authenticated user's current domain

      Returns Promise<unknown>

      Returns Promise object that represents a list of Objects