ApplicationExperience

Data: Gauge Query Node

The Data: Gauge Query Node allows a workflow to retrieve and aggregate recent state data for a specific attribute across devices.

Gauge Query Node

Node Properties

The configuration for the Data: Gauge Query Node is similar to the Gauge Dashboard Block. There are three major components: Device Selection, Query Configuration, and Result Path.

Device Selection

Gauge Query Node Device Selection

The first step is selecting the devices to query. There are several options for selecting devices:

  • Specific Devices and/or Tags: Allows you to either select specific devices and tags, or define a payload path to pull one or more Device IDs off of the current workflow payload to query.
  • Parent System ID: Queries all devices with a specified parent system or all devices that have no parent system. This field is templatable.
  • Experience Group ID: Queries all devices that are associated with a specified Experience Group. This field is templatable.
  • Experience User ID or Email: Queries all devices that are associated with the specified Experience user. This field is templatable.
  • Advanced Query: Allows you to construct your own device query.

In the example above, all devices associated with the Experience group ID found at the {{working.experienceGroupID}} workflow path are queried.

Query Configuration

Gauge Query Node Config

The Data: Gauge Query Node requires the following information:

When querying a single device and requesting only the last data point, no aggregation is needed (since there is only a single value). In the above example, the attribute height is averaged over the last 3 hours for the selected devices.

Result

Gauge Query Node Result

Once the query is configured, the node needs a payload path to know where to store the result on the current workflow payload. The value placed at that path is an object with two properties:

  1. value - the value from the query.
  2. time - the time value for the queried value.
{
  "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
  "value": 7.175925925925926
}

The time field is most useful when using the node to query the “Last received data point” for an attribute, as the time value is the time of that data point.

In the above example, the result is be stored at working.gaugeQueryResult.

Node Example

The payload after the execution of the example Data: Gauge Query Node above looks like:

{
  "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
  "working": {
    "gaugeQueryResult": {
      "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
      "value": 7.175925925925926
    }
  },
  "globals": { },
  "applicationId": "568beedeb436ab01007be53d",
  "applicationName": "Embree",
  "triggerId": "56c794a06895b00100cbe84c",
  "triggerType": "timer",
  "flowId": "56c794a06895b00100cbe84c",
  "flowName": "Query Data"
}

Node Errors

If no devices are found using the query or no data has come from those devices, an empty object is placed at the payload path.

Was this page helpful?


Still looking for help? You can also search the Losant Forums or submit your question there.