Hello,
I try to use a join node to merge the output from a form with a output from a function to generate one json file. Unfortunly without sucsess.
Here is what i have so far:
[
{
"id": "8d9352e68a70b1fd",
"type": "ui_form",
"z": "82ac19b71eb25b31",
"name": "Form_Monitoring_email",
"label": "",
"group": "bab7662c278a9478",
"order": 1,
"width": 5,
"height": 1,
"options": [
{
"label": "HEADER",
"value": "header_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "Recipient I",
"value": "recipient_i_mon",
"type": "email",
"required": false,
"rows": null
},
{
"label": "Recipient ĂŤI",
"value": "recipient_ii_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "Recipient III",
"value": "recipient_iii_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "Recipient IV",
"value": "recipient_iv_mon",
"type": "text",
"required": false,
"rows": null
},
{
"label": "TIME",
"value": "time_mon",
"type": "time",
"required": false,
"rows": null
},
{
"label": "ON/OFF",
"value": "onoff_mon",
"type": "switch",
"required": false,
"rows": null
}
],
"formValue": {
"header_mon": "",
"recipient_i_mon": "",
"recipient_ii_mon": "",
"recipient_iii_mon": "",
"recipient_iv_mon": "",
"time_mon": "",
"onoff_mon": false
},
"payload": "",
"submit": "submit",
"cancel": "",
"topic": "topic",
"topicType": "msg",
"splitLayout": "",
"className": "",
"x": 230,
"y": 980,
"wires": [
[
"5764cc98b83d07a8",
"ef0cb261063f0e03",
"68a215f7e32ede19",
"481883beddbfb833",
"3ee58843037493fc",
"ab9d78458ee8f0c1",
"d53af7de0858a5d1",
"de3608747211ba15",
"115c60abe275ac18"
]
]
},
{
"id": "5764cc98b83d07a8",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_header",
"func": "msg.payload = msg.payload.header_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 900,
"wires": [
[
"638eb62d60cb1f83"
]
]
},
{
"id": "ef0cb261063f0e03",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec1",
"func": "msg.payload = msg.payload.recipient_i_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 940,
"wires": [
[
"d13514091db804d1"
]
]
},
{
"id": "68a215f7e32ede19",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec2",
"func": "msg.payload = msg.payload.recipient_ii_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 980,
"wires": [
[
"7764e1e0525aead9"
]
]
},
{
"id": "481883beddbfb833",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec3",
"func": "msg.payload = msg.payload.recipient_iii_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1020,
"wires": [
[
"82960e75e298387e"
]
]
},
{
"id": "3ee58843037493fc",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_rec4",
"func": "msg.payload = msg.payload.recipient_iv_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1060,
"wires": [
[
"9bf39b9929f32aeb"
]
]
},
{
"id": "ab9d78458ee8f0c1",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_time",
"func": "msg.payload = msg.payload.time_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 1100,
"wires": [
[
"bb50f400ae29fc88"
]
]
},
{
"id": "d53af7de0858a5d1",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "temp_mon_onoff",
"func": "msg.payload = msg.payload.onoff_mon\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 510,
"y": 1140,
"wires": [
[
"b59778d570969767"
]
]
},
{
"id": "bb50f400ae29fc88",
"type": "function",
"z": "82ac19b71eb25b31",
"name": "get hours and minutes",
"func": "const time = new Date(msg.payload)\n// this is the number of milliseconds into the day, if needed\n//const msecLocal = time.getTime() - time.getTimezoneOffset() * 60000\nconst hours = time.getHours()\nconst mins = time.getMinutes()\nmsg.payload = `${hours.toString().padStart(2, \"0\")}:${mins.toString().padStart(2, \"0\")}`\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 700,
"y": 1100,
"wires": [
[
"a7b6fc5b27f43c27",
"115c60abe275ac18"
]
]
},
{
"id": "115c60abe275ac18",
"type": "join",
"z": "82ac19b71eb25b31",
"name": "",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "7",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 670,
"y": 800,
"wires": [
[
"e1c41221f400be93"
]
]
},
{
"id": "de3608747211ba15",
"type": "debug",
"z": "82ac19b71eb25b31",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 400,
"y": 800,
"wires": []
},
{
"id": "bab7662c278a9478",
"type": "ui_group",
"name": "Monitoring email",
"tab": "d95144c56e383182",
"order": 6,
"disp": true,
"width": 5,
"collapse": false,
"className": ""
},
{
"id": "d95144c56e383182",
"type": "ui_tab",
"name": "Jung Von Matt",
"icon": "dashboard",
"order": 2,
"disabled": false,
"hidden": false
}
]
Thank you