Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel3

What is external data?

External data can be added to various data types such as ScenarioSessions, and ScenarioSessionParts. This external data is usually supplied during the creation of these data types. A good example is through our DeepLinks, where extra query params within the link are then added as external data to the new ScenarioSession that is created. For more details on adding external data parameters to sessions see : https://scopearcloud.atlassian.net/wiki/spaces/API/pages/1671987201/Using+Deeplinks#Extensibility

Why do I want to query

...

external data?

Certain data types can be queried using external data. This For example, this might be useful when trying to retrieve sessions using a work order number that was added as external data.

What data types support external data?

Currently there are a few data types that have external data:

  1. Calls

  2. Scenario Sessions

  3. Scenario Steps

  4. Scenario Session Parts

What types of queries are supported for external data?

Currently, there are two types of ways to query external data:

...

In the following examples, both ways will be notedused.

Use Cases

There are numerous use cases for external data to retrieve records.

...

Retrieving Scenario Sessions with External Data

Sessions are created when a user follows a deeplinkdeep link. The extra query params parameters get added to the external data of the scenario session.

...

These are the minimum arguments that are needed to query for all scenario sessions if they are to be queried for external data. There are other arguments that can be added to further refine the results. Check out the GraphQL introspection schema for more information on what other arguments are available.

  • first: How many results are in the query. Maximum of 100 due to request size.

  • externalData key: A string for the key of the value.

...

MATCH Example

This query will return for the first 100 scenario sessions that has have an external data key that matches a single value. For example, the external data might look like this:

...

This query will return for the first 100 scenario sessions that has have an external data key that is one of the value values in a list. For example, the external data might look like this:

Code Block
{"partNumbers": ["1234-ABCD", "5678-EFGH"]}

There are When using the CONTAINS type, you can have many values for the part numbers so the CONTAINS type should be used if only single part number is knownnumber. Any session that has one or more of these values for the part number field will be returned by the query.

CONTAINS Query

Code Block
query FetchScenarioSessionsWithContains(
  $first: Int!,
  $type: String!,
  $key: String!,
  $value: Alphanumeric!
) {
  scenarioSessions(
    first: $first, 
    externalData: {
      type: $type, 
      key: $key, 
      value: $value
    }
  ) 
  {
    nodes {
      nodes {
        id
        databaseId
        sessionType
        externalData
        user {
          id
        }
      }
    }
  }
}

...