Using Gauge Query to Create a Slack Message

Hi there, probably pretty simple one but I seem to be stuck. I’ve attempting to use webook/slack integration so that from slack I can query a device value, and have it reply in slack. I’ve had success setting it up the messaging, but seem to be stuck on getting the actual data inserted into the reply.

I’m attaching a few screenshots showing my workflow and how I’ve set it up. Also you and see from my slack screenshot that something IS making it back, just not the device data I want included. Probably pretty basic, I tried searching the docs/forums but couldn’t find anything similar. Thanks!




Screen Shot 2022-09-12 at 12.59.41 PM

The result of a Gauge Query is an object in the form:

{
  "time": Fri Feb 19 2016 17:26:00 GMT-0500 (EST),
  "value": 7.175925925925926
}

The template you’re sending to Slack is pointing at the object instead of a specific property on the object. Therefore, when the platform attempts to convert it to a string, you get the default string representation of an object, which is [object Object].

If you want just the value, you can change the template to:

{{working.result.value}} is here

If you want to encode the object as a JSON string, you can use the jsonEncode helper:

{{jsonEncode working.result.value}} is here

Thanks, forgot the .value! That solved it and it’s working as expected.

Steve