Hi everyone,
I want to join the function node with the template node, I have tried many ways and nothing, I pass the code I think it is ok. The variables come from a s7 node.
It works the two codes together in a function node with a text node and it shows it in the dashboard but I don't want that. I want the table with that measurement
Thank you very much
Node function
[
{
"id": "c748c39d22d49e95",
"type": "function",
"z": "83f9cf9ed69a8e05",
"name": "",
"func": "var productName = msg.payload['COATEC: Product_Name'];\nvar productNumber = msg.payload['COATEC: Product_Number'];\nvar reportDateMonth = msg.payload['COATEC: Report.Date.Month'];\nvar reportDateYear = msg.payload['COATEC: Report.Date.Year'];\nvar reportDateDay = msg.payload['COATEC: Report.Date.Day'];\nvar date = msg.payload.date || (reportDateMonth + '/' + reportDateDay + '/' + reportDateYear);\nvar reportStartHour = msg.payload['COATEC: Report.Start.Hour'];\nvar reportStartMinute = msg.payload['COATEC: Report.Start.Minute'];\nvar startTime = msg.payload.startTime || (reportStartHour + ':' + reportStartMinute);\nvar reportEndHour = msg.payload['COATEC: Report.End.Hour'];\nvar reportEndMinute = msg.payload['COATEC: Report.End.Minute'];\nvar endTime = msg.payload.endTime || (reportEndHour + ':' + reportEndMinute);\nvar TotalHours = msg.payload['COATEC: Total_Hours'];\nvar TotalSeconds = msg.payload['COATEC: Total_Seconds'];\nvar TotalMinutes = msg.payload['COATEC: Total_Minutes'];\nvar cycleTime = msg.payload.cycleTime || (TotalHours + 'h ' + TotalMinutes + 'm ' + TotalSeconds + 's');\nvar pauseTotalHours = msg.payload['COATEC: Total_Hours_Pause'];\nvar pauseTotalMinutes = msg.payload['COATEC: Total_Minutes_Pause'];\nvar pauseTotalSeconds = msg.payload['COATEC: Total_Seconds_Pause'];\nvar pauseTime = msg.payload.pauseTime || (pauseTotalHours + 'h ' + pauseTotalMinutes + 'm ' + pauseTotalSeconds + 's');\nvar tank1Total = msg.payload['COATEC: Total_Tank_1'];\nvar tank2Total = msg.payload['COATEC: Total_Tank_2'];\nvar minAirTemperature = msg.payload['COATEC: Minimum_Air_Temperature'];\nvar mediumAirTemperature = msg.payload['COATEC: Medium_Air_Temperature'];\nvar maxAirTemperature = msg.payload['COATEC: Maximum_Air_Temperature'];\nvar minFlow = msg.payload['COATEC: Minimum_Flow'];\nvar mediumFlow = msg.payload['COATEC: Medium_Flow'];\nvar maxFlow = msg.payload['COATEC: Maximum_Flow'];\nvar minHumidity = msg.payload['COATEC: Minimum_Humidity'];\nvar mediumHumidity = msg.payload['COATEC: Medium_Humidity'];\nvar maxHumidity = msg.payload['COATEC: Maximum_Humidity'];\n\nmsg.productName = productName;\nmsg.productNumber = productNumber;\nmsg.date = date;\nmsg.startTime = startTime;\nmsg.endTime = endTime;\nmsg.cycleTime = cycleTime;\nmsg.pauseTime = pauseTime;\nmsg.tank1Total = tank1Total;\nmsg.tank2Total = tank2Total;\nmsg.minAirTemperature = minAirTemperature;\nmsg.mediumAirTemperature = mediumAirTemperature;\nmsg.maxAirTemperature = maxAirTemperature;\nmsg.minFlow = minFlow;\nmsg.mediumFlow = mediumFlow;\nmsg.maxFlow = maxFlow;\nmsg.minHumidity = minHumidity;\nmsg.mediumHumidity = mediumHumidity;\nmsg.maxHumidity = maxHumidity;\n\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 480,
"y": 260,
"wires": [
[
"8e1d0898d7bb205e"
]
]
}
]
Node template
[{"id":"8e1d0898d7bb205e","type":"ui_template","z":"83f9cf9ed69a8e05","group":"383ce3322d0766a5","name":"","order":1,"width":20,"height":10,"format":"<p><strong>Work report:</strong></p>\n<table style=\"width: 100%; border-collapse: collapse; border-style: solid; font-size: 11px; font-weight: bold; margin-top: 20px;\" border=\"1\">\n <tbody>\n <tr>\n <td style=\"width: 30%; white-space: nowrap;\"><p><strong>PRODUCT NAME</strong></p></td>\n <td style=\"width: 70%;\">{{productName}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>PRODUCT NUMBER</strong></p></td>\n <td>{{productNumber}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>DATE</strong></p></td>\n <td>{{date}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>START TIME</strong></p></td>\n <td>{{startTime}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>END TIME</strong></p></td>\n <td>{{endTime}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>CYCLE TIME</strong></p></td>\n <td>{{cycleTime}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>PAUSE TIME</strong></p></td>\n <td>{{pauseTime}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>TANK 1 TOTAL</strong></p></td>\n <td>{{tank1Total}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>TANK 2 TOTAL</strong></p></td>\n <td>{{tank2Total}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MINIMUM AIR TEMPERATURE</strong></p></td>\n <td>{{minAirTemperature}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MEDIUM AIR TEMPERATURE</strong></p></td>\n <td>{{mediumAirTemperature}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MAXIMUM AIR TEMPERATURE</strong></p></td>\n <td>{{maxAirTemperature}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MINIMUM FLOW</strong></p></td>\n <td>{{minFlow}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MEDIUM FLOW</strong></p></td>\n <td>{{mediumFlow}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MAXIMUM FLOW</strong></p></td>\n <td>{{maxFlow}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MINIMUM HUMIDITY</strong></p></td>\n <td>{{minHumidity}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MEDIUM HUMIDITY</strong></p></td>\n <td>{{mediumHumidity}}</td>\n </tr>\n <tr>\n <td style=\"white-space: nowrap;\"><p><strong>MAXIMUM HUMIDITY</strong></p></td>\n <td>{{maxHumidity}}</td>\n </tr>\n </tbody>\n</table>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":800,"y":260,"wires":[[]]},{"id":"383ce3322d0766a5","type":"ui_group","name":"reports","tab":"d297a39701056a62","order":1,"disp":false,"width":"25","collapse":false,"className":""},{"id":"d297a39701056a62","type":"ui_tab","name":"REPORTS","icon":"dashboard","order":8,"disabled":false,"hidden":false}]