Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Finding Events by event and value types

This query can be used to find Scenario Session Events of one or many given types (eventTypes argument):

  • CALL_CONNECT

  • CALL_DISCONNECT

  • CHECKLIST_ITEM_COMPLETE

  • CONTINUE_SESSION

  • CREATE_SESSION

  • END_SESSION

  • ENTER_SESSION

  • EXIT_SESSION

  • FINISH_SESSION

  • SCREENSHOT_CAPTURED

  • VIEW_STEP

  • QUIZ_COMPLETE

  • QUIZ_ITEM_COMPLETE

Also, when querying for Events of the type CHECKLIST_ITEM_COMPLETE, a valueTypes argument can be passed in to specify one or many of the following:

  • PHOTO

  • NUMBER

  • BARCODE

  • YES_NO_OPTION

  • BOOLEAN

  • TEXT

  • QUIZ_MULTIPLE_CHOICE_2D

  • QUIZ_MULTIPLE_CHOICE_3D

  • MULTI_OPTION

  • MULTI_OPTION_3D

  • MULTI_SELECT

  • MULTI_SELECT_3D

  • QUIZ_MULTI_SELECT_2D

  • QUIZ_MULTI_SELECT_3D

For instance, when querying for recent Events capturing a photo upload in a checklist item step:

Variables

{
  "first": 10,
  "eventTypes": ["CHECKLIST_ITEM_COMPLETE"],
  "valueTypes": ["PHOTO"],
  "orderBy": {
    "attribute": "startedAt",
    "direction": "DESC"
  }
}

Query

query FetchRecentPhotoChecklistItemCompleteEvents(
  $first: Int,
  $eventTypes: [ScenarioSessionEventTypeEnum!],
  $valueTypes: [ScenarioStepItemTypeEnum!],
  $orderBy: SortOrderInputObject
  ) {
  scenarioSessionEvents(
    first: $first
    orderBy: $orderBy
    eventTypes: $eventTypes,
    valueTypes: $valueTypes
  ) {
  nodes {
      id
      value
      photo {
        fileUrl
      }
    }
  }
}

User and Session arguments to refine the query

In order to narrow down the results in the above sample query to a given User, a User id or username can be passed in.

Also a scenarioSessionId can be used as a filter:

Variables

{
  "first": 10,
  "eventTypes": ["CHECKLIST_ITEM_COMPLETE"],
  "valueTypes": ["PHOTO"],
  "username": "jane.doe",
  "scenarioSessionId": "sR9216ls6ww3Jp9cr4l5hpRiD8XyoEPgvT9PO--6cQC_SjkS9gitsWjSuYw1wTAf",
  "orderBy": {
    "attribute": "startedAt",
    "direction": "DESC"
  }
}

Query

query FetchRecentPhotoChecklistItemCompleteEvents(
  $first: Int,
  $eventTypes: [ScenarioSessionEventTypeEnum!],
  $valueTypes: [ScenarioStepItemTypeEnum!],
  $orderBy: SortOrderInputObject,
  $scenarioSessionId: ID
  $username: String
  ) {
  scenarioSessionEvents(
    first: $first
    orderBy: $orderBy
    eventTypes: $eventTypes,
    valueTypes: $valueTypes,
    scenarioSessionId: $scenarioSessionId,
    user: { username: $username }
  ) {
  nodes {
      id
      value
      photo {
        fileUrl
      }
    }
  }
}

  • No labels