Get value from ctx.payload.results

I'm trying to extract the results from the payload to display in a message for a watcher
The value is in

      "payload": {
        "results": [
          {
            "value": 1644,
            "key": "foo"
          }
        ]
      }

if I try to reference as {{ctx.payload.results}}
I get this:

{0={value=1644, key=foo}}

What I need is only the value 1644, or the key "foo"

I also try to use
ctx.payload.results.value
ctx.payload.results.[0]
ctx.payload.results.['value']

nothing works

Any idea how to get it from the array?

I found it,
ctx.payload.results.0.value

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.