Payload Parser: "TypeError: payload.find is not a function"

Payload Parser: "TypeError: payload.find is not a function"

Hello, I am trying to parse an MQTT payload that comes in to Tago from one of my arduino devices. The payload is made of three comma separated values. Here's a pasted output from the Live Inspector for my device:

  1. { "topic": "your/mqtt/topic", "payload": "455, 68.30, 123.40", "qos": 0, "isHex": false, "bucket": "xxxxxxxxxxxxxxxxxxxxxxxxxx", "messageId": 0 }
(i have removed my actual bucket ID from the above code) .

In my Payload Parser i have: 
  1. const rawValues = payload.find(item => item.variable === "payload");


    if (rawValues)
    {
      const valuesString = rawValues.value;
     
      const splitValues = valuesString.value.split(',');

      const iBatt = splitValues[0];
      const battSoc = splitValues[1];
      const packVolts = splitValues[2];

    payload.push({"variable": "BattCurrent", "value": iBatt, "unit": "A"});
    payload.push({"variable": "SoC", "value": battSoc, "unit": "%"});
    payload.push({"variable": "packVolts", "value": packVolts, "unit": "V"});

    }
No variables appear in my Buckets -> (Device) -> Variables tab.

If i paste an output from the live inspector into the Emulator, i get the error "Function Parse Error: TypeError: payload.find is not a function"

I would be grateful if someone could point out where i'm going wrong. If needed i could change the MQTT payload on the arduino if it makes things easier

Thanks
Tom