The input I'm giving is
{ "payload": [ { "FirstName": "Fred", "Surname": "Smith", "Age": 28, "Address": { "Street": "Hursley Park", "City": "Winchester", "Postcode": "SO21 2JN" }, "Phone": [ { "type": "home", "number": "+44 203 5441234" }, { "type": "office", "number": "00 44 1962 001234" }, { "type": "mobile", "number": "0044 7777-001234" } ] }, { "FirstName": "Freda", "Surname": "Smith", "Age": 25, "Address": { "Street": "Hursley Park", "City": "Winchester", "Postcode": "SO21 2JN" }, "Phone": [ { "type": "home", "number": "+44 203 9871234" }, { "type": "office", "number": "00 44 1962 998765" }, { "type": "mobile", "number": "0044 7777-098765" } ] } ] }
The JSONata expression I'm using is
payload.{FirstName & ' ' & Surname:{"Phone":Phone{type:number}}}
The out put displaying while testing is [ { "Fred Smith": { "Phone": { "home": "+44 203 5441234", "office": "00 44 1962 001234", "mobile": "0044 7777-001234" } } }, { "Freda Smith": { "Phone": { "home": "+44 203 9871234", "office": "00 44 1962 998765", "mobile": "0044 7777-098765" } } } ]
But getting the output after injecting message is
{" ":{"Phone":{}}}
The flow is
[{"id":"f97bd0c3.1907a","type":"tab","label":"Flow 9","disabled":false,"info":""},{"id":"7b267b3f.5f0964","type":"inject","z":"f97bd0c3.1907a","name":"","topic":"","payload":"{\"payload\":[{\"FirstName\":\"Fred\",\"Surname\":\"Smith\",\"Age\":28,\"Address\":{\"Street\":\"Hursley Park\",\"City\":\"Winchester\",\"Postcode\":\"SO21 2JN\"},\"Phone\":[{\"type\":\"home\",\"number\":\"+44 203 5441234\"},{\"type\":\"office\",\"number\":\"00 44 1962 001234\"},{\"type\":\"mobile\",\"number\":\"0044 7777-001234\"}]},{\"FirstName\":\"Freda\",\"Surname\":\"Smith\",\"Age\":25,\"Address\":{\"Street\":\"Hursley Park\",\"City\":\"Winchester\",\"Postcode\":\"SO21 2JN\"},\"Phone\":[{\"type\":\"home\",\"number\":\"+44 203 9871234\"},{\"type\":\"office\",\"number\":\"00 44 1962 998765\"},{\"type\":\"mobile\",\"number\":\"0044 7777-098765\"}]}]}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":240,"wires":[["eb3145fa.7326b8"]]},{"id":"e1a4752d.b7a448","type":"debug","z":"f97bd0c3.1907a","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","x":350,"y":80,"wires":[]},{"id":"eb3145fa.7326b8","type":"change","z":"f97bd0c3.1907a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.{FirstName & ' ' & Surname:{\"Phone\":Phone{type:number}}}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":80,"wires":[["e1a4752d.b7a448"]]}]
Am I missing something.