How to access each value separately in ctx.payload._value

Hi, I have two values in payload the host name and IP Address, which I need to access separately:

      "transform" : {
        "type" : "script",
        "status" : "success",
        "payload" : {
          "_value" : [
            [
              "web01.host.local",
              "10.10.10.10"
            ]
          ]
        }
      },

Executing {{ctx.payload._value}} concatenates both values web01.host.local, 10.10.10.10

I'm looking for something as follow (however it does not work):
{{ctx.payload._value.0}} it should resolve to web01.host.local
{{ctx.payload._value.1}} it should resolve to 10.10.10.10

Thanks in advance

1 Like

The correct answer is {{ctx.payload._value.0.0}} and {{ctx.payload._value.0.1}} as the array is inside another array

1 Like

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