Activity Query Profiles

Activity query profiles allow activity queries to be grouped for asssignment to relevant employees and managers.

Activity queries allow employees and managers to search for activities that are relevant to them. Queries are helpful if there are many activities that need to be available to employees. Activity queries can be configured to filter out activities based on:

  • Query user’s home labor account
  • Query user’s labor transfer set
  • Labor accounts in account sets
  • Activity completion and held status
  • Activity type (direct or indirect)
  • Time period within which activity start or end dates fall
  • Activity name

Prerequisites

You should create activities and create activity queries before creating activity profiles.

Note: If you do not need to create custom activity queries, the system contains several default activity queries that can be used to create activity profiles. Call the Retrieve All Activity Queries or by Name GET /v1/work/queries operation to retrieve a list of all available activity queries.

Pre-defined activity query profiles

There are two pre-defined activity query profiles:

Pre-defined activity query profileDescription
All QueriesInitially contains only the pre-defined activity queries. As you create activity queries, the system automatically adds them to the All Activity Queries profile.
Default ProfileContains the pre-defined All Activities query.

Example

In this example, we create, verify, update, and delete an activity query profile.

Create an activity query profile

The create request:

  • creates a new activity query profile named: Direct and Incomplete Queries
  • assigns the Direct and Incomplete queries to the profile
  • assigns an Access Level Type of All Activity Levels
  • does not set this activity query profile as the system default

Example request

Call the Create Activity Profile POST /v1/work/activity_profiles operation with the following request payload.

{
        "name": "Direct and Incomplete Queries",
        "description": "This profile contains Direct and Incomplete queries, which include direct activities that have an Incomplete completion status.",
        "displayActivitySelectInDevices": false,
        "queries": [
            {
                "id": -13,
                "qualifier": "Direct"
            },
            {
                "id": -6,
                "qualifier": "Incomplete"
            }
        ],
        "accessLevelType": {
            "id": 0,
            "qualifier": "All Activity Levels"
        },
        "version": 1,
        "default": false
    }

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

{
    "id": 501,
    "name": "Direct and Incomplete Queries",
    "description": "This profile contains Direct and Incomplete queries, which include direct activities that have an Incomplete completion status.",
    "displayActivitySelectInDevices": false,
    "queries": [
        {
            "id": -13,
            "qualifier": "Direct"
        },
        {
            "id": -6,
            "qualifier": "Incomplete"
        }
    ],
    "accessLevelType": {
        "id": 0,
        "qualifier": "All Activity Levels"
    },
    "version": 1,
    "default": false
}

Verify

To verify, call the Retrieve Activity Profile by ID GET /v1/work/query_profiles/{id} or the Retrieve All Activity Profiles or by Name GET /v1/work/query_profiles?name={name} operation.

Calling GET /v1/work/query_profiles/501 or GET /v1/work/query_profiles?name=Direct and Incomplete Queries returns:

{
    "id": 501,
    "name": "Direct and Incomplete Queries",
    "description": "This profile contains Direct and Incomplete queries, which include direct activities that have an Incomplete completion status.",
    "displayActivitySelectInDevices": false,
    "queries": [
        {
            "id": -13,
            "qualifier": "Direct"
        },
        {
            "id": -6,
            "qualifier": "Incomplete"
        }
    ],
    "accessLevelType": {
        "id": 0,
        "qualifier": "All Activity Levels"
    },
    "version": 1,
    "default": false
}

Note: The Retrieve All Activity Profiles or by Name GET /v1/work/query_profiles?name=Direct and Incomplete Queries operation returns the object above enclosed in an array, since omitting the name query parameter returns all activity query profiles in the system.

Update the profile

To update the activity query profile to display the Activity Select option on device displays, call the Update Activity Profile by ID PUT /v1/work/query_profiles/501 operation with the following request payload.

Example request

{
        "id": 501,
        "name": "Direct and Incomplete Queries",
        "description": "This profile contains Direct and Incomplete queries, which include direct activities that have an Incomplete completion status.",
        "displayActivitySelectInDevices": true,
        "queries": [
            {
                "id": -13,
                "qualifier": "Direct"
            },
            {
                "id": -6,
                "qualifier": "Incomplete"
            }
        ],
        "accessLevelType": {
            "id": 0,
            "qualifier": "All Activity Levels"
        },
        "version": 1,
        "default": false
    }

Example response

{
    "id": 501,
    "name": "Direct and Incomplete Queries",
    "description": "This profile contains Direct and Incomplete queries, which include direct activities that have an Incomplete completion status.",
    "displayActivitySelectInDevices": true,
    "queries": [
        {
            "id": -13,
            "qualifier": "Direct"
        },
        {
            "id": -6,
            "qualifier": "Incomplete"
        }
    ],
    "accessLevelType": {
        "id": 0,
        "qualifier": "All Activity Levels"
    },
    "version": 2,
    "default": false
}

Note that the version is automatically incremented to 2. To successfully update this profile again, you must pass version 2 in the request body.

Delete a profile

To delete this activity profile, call the Delete Activity Profile by ID DELETE /v1/work/query_profiles/501 operation.

The system returns HTTP status 204 with an empty response body.