How do I add an object to a payload?
Here is what I have
[{"id":"d221c2c7.dcf32","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"d92f539e.01a78","type":"inject","z":"d221c2c7.dcf32","name":"create fault","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"alarm","payload":"[{\"timestamp\":\"1610488691209\",\"fault\":\"Bathroom\"}]","payloadType":"json","x":180,"y":80,"wires":[["385c74a6.71e1fc"]]},{"id":"7b7b8ba6.0deb14","type":"ui_table","z":"d221c2c7.dcf32","group":"37b5f1bd.773eae","name":"","order":1,"width":"6","height":"4","columns":[],"outputs":1,"cts":true,"x":780,"y":220,"wires":[[]]},{"id":"12b4a833.ab7ef8","type":"inject","z":"d221c2c7.dcf32","name":"no fault","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"alarm","payload":"[{\"timestamp\":\"\",\"fault\":\"\"}]","payloadType":"json","x":170,"y":140,"wires":[["385c74a6.71e1fc"]]},{"id":"9139f5f2.5c8b08","type":"inject","z":"d221c2c7.dcf32","name":"create fault","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"alarm","payload":"[{\"timestamp\":\"1610488691209\",\"fault\":\"kitchen\"}]","payloadType":"json","x":180,"y":300,"wires":[["e22fb67e.179248"]]},{"id":"5475d1b0.9d254","type":"inject","z":"d221c2c7.dcf32","name":"no fault","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"alarm","payload":"[{\"timestamp\":\"\",\"fault\":\"\"}]","payloadType":"json","x":170,"y":360,"wires":[["e22fb67e.179248"]]},{"id":"88a6e89c.4cb5f8","type":"function","z":"d221c2c7.dcf32","name":"add to schedule","func":"var x;\nvar msg1;\n\nmsg1 = {payload: flow.get(\"fault1\")};\nmsg1.payload[1] = flow.get(\"fault2\");\n\nreturn msg1; \n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":590,"y":220,"wires":[["7b7b8ba6.0deb14","c21a6a95.b5d448"]]},{"id":"e22fb67e.179248","type":"change","z":"d221c2c7.dcf32","name":"ui_control","rules":[{"t":"set","p":"fault2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":320,"wires":[["88a6e89c.4cb5f8"]]},{"id":"385c74a6.71e1fc","type":"change","z":"d221c2c7.dcf32","name":"ui_control","rules":[{"t":"set","p":"fault1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":380,"y":120,"wires":[["88a6e89c.4cb5f8"]]},{"id":"c21a6a95.b5d448","type":"debug","z":"d221c2c7.dcf32","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":800,"y":140,"wires":[]},{"id":"37b5f1bd.773eae","type":"ui_group","name":"1750+ 1 alarms","tab":"78efbcf6.3781f4","order":2,"disp":true,"width":"6","collapse":false},{"id":"78efbcf6.3781f4","type":"ui_tab","name":"Scheduler","icon":"autorenew","order":2,"disabled":false,"hidden":false}]
Here is the result
As you can see, it added the object, but as an array. I need them both to be objects (like [0]). How do I do this?