Understanding QuickQueries

Topics

QuickQuery Overview

A QuickQuery is a pre-defined search/filter that you can use to quickly access a list of items that meet certain conditions. For example, you can set up a QuickQuery that displays a list of records assigned to a certain department or even a certain individual. Your agency administrator may set up QuickQueries and make them available for your use, or you can create your own QuickQueries.

QuickQueries are available for use in a number of portlets. If available, you will see a My QuickQueries button in portlet toolbar and a My QuickQueries command in Menu command list.

When you set up multiple QuickQueries, you can assign one query as the primary (default) query. When you designate a QuickQuery as primary, Civic Platform automatically applies that QuickQuery each time you open the list portlet or tab.

Note:

Data filters remain in place when you apply a QuickQuery. Any fields or values that a data filter excludes, remain excluded.

Applying an Existing QuickQuery to a List Portlet

  1. Navigate to the portlet you want to work in.

  2. From the My QuickQueries drop-down list in the portlet toolbar, choose the desired query.

    • To apply the QuickQuery to a particular module, select a module from the Module drop-down list.

    • To apply the QuickQuery to all available modules, select “--Select--” from the Module drop-down list.

    • To filter the contents of other list portlets besides the record list portlets, select the desired QuickQuery from the My QuickQueries drop-down list.

    • To remove all QuickQuery filters from the list, choose --Select-- from the My QuickQueries drop-down list.

      The list updates to display only those records that match the QuickQuery specifications.

Creating a New QuickQuery

You can set up a QuickQuery that reflects your own needs.

Note:

When creating a QuickQuery, you can use wildcards for some values. For example, if you want to build a QuickQuery that finds all records related to work on water mains, you can enter “Water/Main//” where //is the wildcard.

  1. Navigate to the portlet you want to work in.

  2. Hover over the Menu button to display a menu, then choose My QuickQueries from the menu.

  3. Click New.

    A blank QuickQuery form displays.

  4. Complete these fields (a red asterisk means it is a required field):

    Name Enter a name for the QuickQuery. The name you enter appears in the QuickQuery drop-down list, so make sure the name is concise and meaningful.
    Description Enter a description to help you identify the purpose of the QuickQuery.
    Primary This field is optional. Select Yes to designate the current QuickQuery as the primary. The default setting is No. Only one QuickQuery can be primary at any given time. If you assign another QuickQuery as the primary, Civic Platform automatically resets the Primary field for all other QuickQueries to No.
  5. Use the Search By section to build your query as described below.



    1. Use Box A only if you are creating an extremely complex query that requires parentheses to group operations properly. For most QuickQueries, you can leave this box blank.

    2. Use Box B to choose the portlet field that you want to use to build your query.

      Note:

      The current portlet sets the available filter fields:

      The filter fields for Record List portlet include all the record fields that display in the record search form, Application-Specific Info, Address Template, Owner Template, Parcel Template, and Module Name.

      The filter fields for the Reference Address (Parcel, or Owner) Portlet include the address (parcel, or owner) fields, and Address Template (Parcel Template, or Owner Template).

      The filter fields for other portlets are the fields that display in the search form of each portlet.

      If you select Application-Specific Info (ASI) as the filter field in the drop-down, Civic Platform displays all the ASI groups in a pop-up window. Select an ASI group code from the ASI Group Code field, and then find and click the desired ASI field in the ASI Field tree to specify the field you want to filter.

      If you select Address Template, Parcel Template, or Owner Template as the filter field in the drop-down, Civic Platform displays all the active template attributes in a pop-up window. Click the desired attribute to specify the field you want to filter.

    3. Use Box C to choose the Relational Operator you want to use. For a list of available operators, see Default Relational Operators.

    4. Use Box D to specify the variable or specific value against which you want to compare the field in Box B. You can manually enter a value into this field, or you can click the Variable Picker button to the right of the field and select a variable from the Variable list. For a list of variables, see QuickQuery Parameters.

    5. If you select a user-name-related field, such as Requestor, as the filter field, Civic Platform displays three fields where you can specify the first name, middle name, and last name of a person, instead of one Value field. For a list of user-name-related portlets and filter fields, see User-Name-Related List Portlets and Search By Fields.



      However, if you pick a variable as the search criteria, Civic Platform turns the three fields into a read-only Full Name field and populates the field with the specified variable.

    6. Use Box E only if you are creating a complex query that requires parentheses to group operations properly. For most simple QuickQueries, you can leave this box blank.

    7. If you are querying additional fields (for example, you want to query by date and/or by location), choose a logical operator in the fourth field to determine how you want to combine the fields. Choose AND if you want the query to use both this field and the next field to find matches. Choose OR if you want the query to use either this field or the next field to find matches.

  6. If you are querying another field (see step 5f), click the New Field button. Otherwise, go to the next step.

    Civic Platform adds a new Search By row below the one you just created.

    1. Repeat steps 5 and 6 for each additional field you want to add. When you have finished adding fields, continue to step 7.

  7. Click the Preview SQL button to view the SQL query statement in the Resulting Query field, which can help you identify any potential syntax problems before you save.

  8. Click the Submit button.

    The QuickQuery is now available in the current portlet.

    Table 1. User-Name-Related List Portlets and Search By Fields
    List Portlet Search By Field
    AMS Asset CA List Inspector
    AMS PM Schedule Log List Processed By Staff
    Inspection Conditions of Approval List Action by User

    Applied by User

    Inspection List Inspection Contact Name

    Inspector

    Requestor
    My Workflow Task List Action By (Staff)Assigned to Staff
    Record Conditions of Approval List Action by User

    Applied by User

    Record Inspection List Inspection Contact Name

    Requestor

    Set Conditions of Approval List Action by User

    Applied by User

Modifying or Deleting an Existing QuickQuery

You can modify or remove QuickQueries you created as needed. However, QuickQueries created by administrators are read-only and are not editable.

To modify or delete a QuickQuery

  1. Navigate to the portlet you want to work in.

  2. Hover the mouse on the Menu button to display a menu.

  3. Choose My QuickQueries from the menu.

    A list of QuickQueries displays for the current portlet.

  4. Click the link for the query you want to modify/delete.

  5. If modifying the query, update as needed. Click Delete Field to remove fields from your query as needed.

  6. To delete the query, click Delete.

Relational Operators

Understanding the QuickQuery Form

You can use parameters to build queries on the QuickQuery form.

Table 2. QuickQuery Parameters
Variable Description
$$DEPARTMENT$$ The department to which the current user belongs.
$$GAUSER ID$$ The logged in user’s ID.
$$GROUP$$ The logged in user’s user group.
$$MODULE$$ The name of the module for which the query is applicable.
$$ORGANIZATION$$ All organizations. A Citizen Access term.
$$OWNORGANIZATION$$ The logged in user’s organizations. A Citizen Access term.
$$OWNLICENSE$$ The logged in user’s licenses. A Citizen Access term.
$$PUBLICUSER_EMAIL$$ The logged in user’s email. A Citizen Access term.
$$SERV_PROV_CODE$$ The login user’s agency code
$$TODAY+/-#$$ Today’s date (the workstation system date), or a range of days. For example: Enter
$$TODAY-7$$
as the value for the Inspection Date field to return all records with inspection dates in the past week. Similarly, enter
$$TODAY+7$$
to return records with inspection dates occurring in the week to come.
$$TODAY+n$$ Date range beginning with today’s date.
$$USERID$$ The ID of the user currently logged on.
$$USERFULLNAME$$ The logged in user’s full name.

Relational operators define the relationship between the field you select and the value you want to compare that field against. For example, if you choose the City field and enter Portland as a value, you can then pick which relational operator you want to define what data to find. If you want records for Portland, you can use =. If you want all records except for Portland, you can use !=. The table below lists the default relational operators available for use.

Table 3. Default Relational Operators
= Equal to
!= Not equal to
< Less than
<= Less than or equal to
> Greater than
>= Greater than or equal to
LIKE Contains part of the field value.
IS NULL Use to identify field values that are empty (no field value entered).
IS NOT NULL Use to identify field values that are not empty (field value entered).
CONTAINS Contains all of the field value.