# Error In Dashboard creation

**URL:** <https://discourse.nodered.org/t/error-in-dashboard-creation/18181>\
**Category:** Dashboard\
**Created:** [20 November 2019 07:47 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181 "2019-11-20T07:47:50Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 07:47 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/1 "2019-11-20T07:47:50Z")

</div>

Hello, I created a dashboard where i can change the values of the variables in the function node. However I am getting an error when i deploy it stating that the variables are not defined. And also there is no change even when i change values in the dashboard. Can someone please help me out with it? I have shared the flow below.

[{"id":"7149cb47.db2534","type":"function","z":"869769d1.0b9f98","name":"Calculate average","func":"data=flow.get("data") || {};\nif (data.FIELD\_WIDTH===undefined)\n var FIELD\_WIDTH=100;\nelse\n var FIELD\_WIDTH=parseInt(data.FIELD\_WIDTH);\n\n\nif (data.FIELD\_HEIGHT ===undefined)\n var FIELD\_HEIGHT =100;\nelse\n var FIELD\_HEIGHT =parseInt(data.FIELD\_HEIGHT);\n \nif (data.FIELD\_HORIZONTAL ===undefined)\n var FIELD\_HORIZONTAL = 6;\nelse\n var FIELD\_HORIZONTAL =parseInt(data.FIELD\_HORIZONTAL); \n \nif (data.FIELD\_VERTICAL ===undefined)\n var FIELD\_VERTICAL = 20;\nelse\n var FIELD\_VERTICAL =parseInt(data.FIELD\_VERTICAL); \n \nmsg.payload ="FIELD\_WIDTH ="+FIELD\_WIDTH +" FIELD\_HEIGHT ="+FIELD\_HEIGHT+"FIELD\_HORIZONTAL ="+FIELD\_HORIZONTAL+"FIELD\_VERTICAL ="+FIELD\_VERTICAL;\nnode.log(msg.payload);\n//////////////////////////////\n\n\n\n\nconst inputArray = new Array (msg.payload.length);\n for (var n = 0 ; n \< inputArray.length ; n++) {\n inputArray[n] = Object.values(msg.payload[n]);\n }\n\n // width and height of heating fields in pixels\n // dependant on distance between camera and object\n\n //const FIELD\_WIDTH = 100;// 100;\n //const FIELD\_HEIGTH = 100;// 100;\n \n\n // Width resolution of Images\n\n const RES\_WIDTH = 100;// 100;\n\n // # of heating fields to calculate\n\n //const FIELDS\_HORIZONTAL = 6;// 6;\n\n // because of zig-zag recording of camera 1 to generate same layouts.\n\n //const FIELDS\_VERTICAL = 20;// 20;\n\n // first field starts half the field amount in length from middle of the image.\n\n // const HEATING\_FIELD\_START\_HORIZONTAL = RES\_WIDTH/2 - FIELDS\_HORIZONTAL/2 \* FIELD\_WIDTH;\n const HEATING\_FIELD\_START\_HORIZONTAL = 0;\n\n // Detect start of Fields// emperic values maybe?\n\n var HEATING\_FIELD\_START\_DETECTION = detectStartHeating(inputArray);\n var HEATING\_FIELD\_END\_DETECTION = detectEndHeating(inputArray);\n // var HEATING\_FIELD\_START\_VERTICAL = (HEATING\_FIELD\_END\_DETECTION - HEATING\_FIELD\_START\_DETECTION )/ 2 + HEATING\_FIELD\_START\_DETECTION - FIELDS\_VERTICAL/2 \* FIELD\_HEIGTH;\n var HEATING\_FIELD\_START\_VERTICAL = 0;\n\n // Creating an empty output Array with the set no fields\n\n var outputArray = new Array (FIELDS\_VERTICAL);\n for (var k = 0 ; k\< outputArray.length ; k++) {\n outputArray[k] = new Array (FIELDS\_HORIZONTAL);\n for ( var l = 0; l\< outputArray[k].length; l++) {\n outputArray[k][l] = 0;\n }\n }\n\n var tmp2 = 0;\n\n // loop through the fields\n\n for (var v = 0 ; v \< FIELDS\_VERTICAL ; v++) {\n for ( var h = 0; h \< FIELDS\_HORIZONTAL ; h++) {\n \n //calculate median of each field\n var tmp = 0 ;\n for ( var y = HEATING\_FIELD\_START\_VERTICAL + v \* FIELD\_HEIGTH ; y \< HEATING\_FIELD\_START\_VERTICAL + v \* FIELD\_HEIGTH + FIELD\_HEIGTH; y++) {\n for (var x = HEATING\_FIELD\_START\_HORIZONTAL + h \* FIELD\_WIDTH; x \< HEATING\_FIELD\_START\_HORIZONTAL + h \* FIELD\_WIDTH + FIELD\_WIDTH; x++) {\n tmp += parseFloat(inputArray[y]);\n }\n }\n \n // round to 2 decimals\n tmp = tmp / (FIELD\_WIDTH \* FIELD\_HEIGTH)\n \n // no of decimal digits\n \n tmp = Math.round(tmp);\n outputArray[v][h] = tmp;\n\t\t}\n }\n \n // Create an empty array to insert the data\n // The desired output has 7 rows\n var newOutput = new Array (7);\n for (var k = 0 ; k\< newOutput.length ; k++) {\n // Every row contains as much elements as the total number of fields\n newOutput[k] = new Array (FIELDS\_HORIZONTAL \* FIELDS\_VERTICAL);\n for ( var l = 0; l\< newOutput[k].length; l++) {\n newOutput[k][l] = 0;\n }\n }\n\n // Map the current result to the format desired\n // 7 rows were\n // row0 PixelName\n // row1 Width\n // row2 Height\n // row3 X\n // row4 Y\n // row5 Average\n // row6 Consecutive pixel name\n let firstRowIndex = 0;\n for (let rowIndex = 0; rowIndex \< outputArray.length; rowIndex++) {\n const row = outputArray[rowIndex];\n for (let colIndex = 0; colIndex \< row.length; colIndex++) {\n const col = row[colIndex];\n // Determine the name\n const pixelName = `${getLettherForRowNumber(rowIndex)}${colIndex}`;\n newOutput[0][firstRowIndex] = pixelName;\n newOutput[1][firstRowIndex] = FIELD\_WIDTH ; // Width\n newOutput[2][firstRowIndex] = FIELD\_HEIGTH; // Height\n newOutput[3][firstRowIndex] = colIndex \* FIELD\_WIDTH; // X\n newOutput[4][firstRowIndex] = rowIndex \* FIELD\_HEIGTH; // Y\n newOutput[5][firstRowIndex] = col; // Average\n // Determine the name 2\n const pixelName2 = `a${firstRowIndex}`;\n newOutput[6][firstRowIndex] = pixelName2;\n firstRowIndex++;\n }\n }\n\t\n\tmsg.payload = newOutput;\n\t\n return msg;\n\n\t\nfunction detectStartHeating(inputArray) {\n\t \n\t// Haet difference from cool row to first heated row, how much hotter does the first heated row to be ?\n \n const THRESHOLD = 5;\n\n var hotRow = 0 ;\n var currentRowAverage = calcRowAverage(inputArray, hotRow);\n hotRow++;\n \n var nextRowAverage = calcRowAverage(inputArray,hotRow);\n while( currentRowAverage + THRESHOLD \> nextRowAverage && currentRowAverage \> -1 && nextRowAverage \> -1) {\n\n currentRowAverage = nextRowAverage;\n hotRow++;\n nextRowAverage = calcRowAverage(inputArray,hotRow);\n }\n if (nextRowAverage == -1 || currentRowAverage == -1) {\n return 0;\n } else {\n return hotRow;\n }\n }\n\nfunction detectEndHeating(inputArray) {\n // heat difference from cool row to first heated row , how much hotter does the first heated row have to on average?\n \n const THRESHOLD = 40;\n var hotRow = inputArray.length - 1;\n var currentRowAverage = calcRowAverage(inputArray, hotRow);\n hotRow--;\n\n var prevRowAverage = calcRowAverage(inputArray,hotRow);\n\n while ( currentRowAverage + THRESHOLD \> prevRowAverage && currentRowAverage \> -1 && prevRowAverage \> -1 && hotRow\>0) {\n currentRowAverage = prevRowAverage;\n hotRow--;\n prevRowAverage = calcRowAverage(inputArray,hotRow);\n \n }\n if( prevRowAverage == -2 || currentRowAverage == -1) {\n return 0 ;\n }\n\n else\n {\n return hotRow;\n }\n }\n \nfunction calcRowAverage(inputArray,row) {\n var res = 0;\n if (inputArray.length \< row) {\n return -1;\n }\n\n\n for (var g = 0; g\< inputArray[row].length; g++) {\n res += inputArray[row][g];\n }\n return res/inputArray[row].length;\n}\t \n\nfunction getLettherForRowNumber(rowNumber) {\n // ASCII code for 'a' is 97, 122 for 'z'\n if (rowNumber \< 26) {\n return String.fromCharCode(97 + rowNumber);\n } else {\n const asciiFirstLetter = Math.round(rowNumber / 25) - 1;\n const mod = rowNumber % 25 - 1;\n const firstLetter = String.fromCharCode(97 + asciiFirstLetter);\n const secondLetter = String.fromCharCode(97 + mod);\n return `${firstLetter}${secondLetter}`;\n }\n}\n","outputs":1,"noerr":0,"x":730,"y":260,"wires":[["261a99d3.e937d6"]]}]

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 08:05 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/2 "2019-11-20T08:05:17Z")

</div>

Please export your flow again, [read this post](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506) and edit your post with correct formatting.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 08:12 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/3 "2019-11-20T08:12:59Z")

</div>

```auto
[{"id":"77c167c.525f118","type":"csv","z":"869769d1.0b9f98","name":"ReadCSV","sep":";","hdrin":"","hdrout":"","multi":"mult","ret":"\\n","temp":"","skip":"0","x":540,"y":240,"wires":[["7149cb47.db2534"]]},{"id":"ab353a21.7322c8","type":"file in","z":"869769d1.0b9f98","name":"","filename":"C:\\Users\\Public\\Varun\\PreHeating_2019-09-13_19-23-41.csv","format":"utf8","chunk":false,"sendError":false,"x":470,"y":160,"wires":[["77c167c.525f118"]]},{"id":"e32aed0c.07adc8","type":"function","z":"869769d1.0b9f98","name":"Selecting the file","func":"\nmsg.filename = \"\\\\\\\\C:\\\\Users\\\\Public\\\\Varun\\\\PreHeating_2019-09-13_19-23-41.csv\";\nreturn msg;\n","outputs":1,"noerr":0,"x":510,"y":60,"wires":[[]]},{"id":"261a99d3.e937d6","type":"debug","z":"869769d1.0b9f98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":930,"y":260,"wires":[]},{"id":"ad0062d2.b30398","type":"inject","z":"869769d1.0b9f98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":60,"wires":[["ab353a21.7322c8"]]},{"id":"408bd299.6ad834","type":"ui_text_input","z":"869769d1.0b9f98","name":"FIELD WIDTH","label":"FIELD WIDTH","tooltip":"","group":"ff81e701.9afc9","order":1,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"field_width","x":240,"y":440,"wires":[["731e03a2.371194"]]},{"id":"a9963b5a.93ba3","type":"ui_text_input","z":"869769d1.0b9f98","name":"FIELD HEIGHT","label":"FIELD HEIGHT","tooltip":"","group":"ff81e701.9afc9","order":2,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"field_height","x":220,"y":500,"wires":[["2fb6a081.8c592"]]},{"id":"9bbcc520.a80ea8","type":"ui_text_input","z":"869769d1.0b9f98","name":"FIELD HORIZONTAL","label":"FIELD HORIZONTAL","tooltip":"","group":"ff81e701.9afc9","order":3,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"field_horizontal","x":240,"y":560,"wires":[["8bcdf72d.226fc"]]},{"id":"a097e777.c6f9e8","type":"ui_text_input","z":"869769d1.0b9f98","name":"FIELD VERTICAL","label":"FIELD VERTICAL","tooltip":"","group":"ff81e701.9afc9","order":4,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"field_vertical","x":250,"y":620,"wires":[["19baa446.20880c"]]},{"id":"731e03a2.371194","type":"change","z":"869769d1.0b9f98","name":"","rules":[{"t":"set","p":"data[\"FIELD_WIDTH\"]","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":440,"wires":[[]]},{"id":"2fb6a081.8c592","type":"change","z":"869769d1.0b9f98","name":"","rules":[{"t":"set","p":"data[\"FIELD_HEIGHT\"]","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":520,"wires":[[]]},{"id":"8bcdf72d.226fc","type":"change","z":"869769d1.0b9f98","name":"","rules":[{"t":"set","p":"data[\"FIELD_HORIZONTAL\"]","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":534,"y":574,"wires":[[]]},{"id":"19baa446.20880c","type":"change","z":"869769d1.0b9f98","name":"","rules":[{"t":"set","p":"data[\"FIELD_VERTICAL\"]","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":627,"wires":[[]]},{"id":"e609671f.6c7938","type":"function","z":"869769d1.0b9f98","name":"test","func":"data=flow.get(\"data\") || {};\nif (data.FIELD_WIDTH===undefined)\n var FIELD_WIDTH=100;\nelse\n var FIELD_WIDTH=parseInt(data.FIELD_WIDTH);\n\n\nif (data.FIELD_HEIGHT ===undefined)\n var FIELD_HEIGHT =100;\nelse\n var FIELD_HEIGHT =parseInt(data.FIELD_HEIGHT);\n \nif (data.FIELD_HORIZONTAL ===undefined)\n var FIELD_HORIZONTAL = 6;\nelse\n var FIELD_HORIZONTAL =parseInt(data.FIELD_HORIZONTAL); \n \nif (data.FIELD_VERTICAL ===undefined)\n var FIELD_VERTICAL =20;\nelse\n var FIELD_VERTICAL =parseInt(data.FIELD_VERTICAL); \n \nmsg.payload =\"FIELD_WIDTH =\"+FIELD_WIDTH +\" FIELD_HEIGHT =\"+FIELD_HEIGHT+\"FIELD_HORIZONTAL =\"+FIELD_HORIZONTAL+\"FIELD_VERTICAL =\"+FIELD_VERTICAL;\nnode.log(msg.payload);\nreturn msg;\n","outputs":1,"noerr":0,"x":350,"y":700,"wires":[["f6de2708.0ac998"]]},{"id":"f6de2708.0ac998","type":"debug","z":"869769d1.0b9f98","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":490,"y":740,"wires":[]},{"id":"a0a834d9.e4d5f","type":"inject","z":"869769d1.0b9f98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":720,"wires":[["e609671f.6c7938"]]},{"id":"260b965c.fa64c2","type":"ui_button","z":"869769d1.0b9f98","name":"CALCULATE","group":"ff81e701.9afc9","order":5,"width":0,"height":0,"passthru":false,"label":"CALCULATE","tooltip":"","color":"white","bgcolor":"red","icon":"","payload":"1","payloadType":"str","topic":"","x":210,"y":360,"wires":[["ab353a21.7322c8"]]},{"id":"7149cb47.db2534","type":"function","z":"869769d1.0b9f98","name":"Calculate average","func":"data=flow.get(\"data\") || {};\nif (data.FIELD_WIDTH===undefined)\n var FIELD_WIDTH=100;\nelse\n var FIELD_WIDTH=parseInt(data.FIELD_WIDTH);\n\n\nif (data.FIELD_HEIGHT ===undefined)\n var FIELD_HEIGHT =100;\nelse\n var FIELD_HEIGHT =parseInt(data.FIELD_HEIGHT);\n \nif (data.FIELD_HORIZONTAL ===undefined)\n var FIELD_HORIZONTAL = 6;\nelse\n var FIELD_HORIZONTAL =parseInt(data.FIELD_HORIZONTAL); \n \nif (data.FIELD_VERTICAL ===undefined)\n var FIELD_VERTICAL = 20;\nelse\n var FIELD_VERTICAL =parseInt(data.FIELD_VERTICAL); \n \nmsg.payload =\"FIELD_WIDTH =\"+FIELD_WIDTH +\" FIELD_HEIGHT =\"+FIELD_HEIGHT+\"FIELD_HORIZONTAL =\"+FIELD_HORIZONTAL+\"FIELD_VERTICAL =\"+FIELD_VERTICAL;\nnode.log(msg.payload);\n//////////////////////////////\n\n\n\n\nconst inputArray = new Array (msg.payload.length);\n for (var n = 0 ; n < inputArray.length ; n++) {\n inputArray[n] = Object.values(msg.payload[n]);\n }\n\n // width and height of heating fields in pixels\n // dependant on distance between camera and object\n\n //const FIELD_WIDTH = 100;// 100;\n //const FIELD_HEIGTH = 100;// 100;\n \n\n // Width resolution of Images\n\n const RES_WIDTH = 100;// 100;\n\n // # of heating fields to calculate\n\n //const FIELDS_HORIZONTAL = 6;// 6;\n\n // because of zig-zag recording of camera 1 to generate same layouts.\n\n //const FIELDS_VERTICAL = 20;// 20;\n\n // first field starts half the field amount in length from middle of the image.\n\n // const HEATING_FIELD_START_HORIZONTAL = RES_WIDTH/2 - FIELDS_HORIZONTAL/2 * FIELD_WIDTH;\n const HEATING_FIELD_START_HORIZONTAL = 0;\n\n // Detect start of Fields// emperic values maybe?\n\n var HEATING_FIELD_START_DETECTION = detectStartHeating(inputArray);\n var HEATING_FIELD_END_DETECTION = detectEndHeating(inputArray);\n // var HEATING_FIELD_START_VERTICAL = (HEATING_FIELD_END_DETECTION - HEATING_FIELD_START_DETECTION )/ 2 + HEATING_FIELD_START_DETECTION - FIELDS_VERTICAL/2 * FIELD_HEIGTH;\n var HEATING_FIELD_START_VERTICAL = 0;\n\n // Creating an empty output Array with the set no fields\n\n var outputArray = new Array (FIELDS_VERTICAL);\n for (var k = 0 ; k< outputArray.length ; k++) {\n outputArray[k] = new Array (FIELDS_HORIZONTAL);\n for ( var l = 0; l< outputArray[k].length; l++) {\n outputArray[k][l] = 0;\n }\n }\n\n var tmp2 = 0;\n\n // loop through the fields\n\n for (var v = 0 ; v < FIELDS_VERTICAL ; v++) {\n for ( var h = 0; h < FIELDS_HORIZONTAL ; h++) {\n \n //calculate median of each field\n var tmp = 0 ;\n for ( var y = HEATING_FIELD_START_VERTICAL + v * FIELD_HEIGTH ; y < HEATING_FIELD_START_VERTICAL + v * FIELD_HEIGTH + FIELD_HEIGTH; y++) {\n for (var x = HEATING_FIELD_START_HORIZONTAL + h * FIELD_WIDTH; x < HEATING_FIELD_START_HORIZONTAL + h * FIELD_WIDTH + FIELD_WIDTH; x++) {\n tmp += parseFloat(inputArray[y][x]);\n }\n }\n \n // round to 2 decimals\n tmp = tmp / (FIELD_WIDTH * FIELD_HEIGTH)\n \n // no of decimal digits\n \n tmp = Math.round(tmp);\n outputArray[v][h] = tmp;\n\t\t}\n }\n \n // Create an empty array to insert the data\n // The desired output has 7 rows\n var newOutput = new Array (7);\n for (var k = 0 ; k< newOutput.length ; k++) {\n // Every row contains as much elements as the total number of fields\n newOutput[k] = new Array (FIELDS_HORIZONTAL * FIELDS_VERTICAL);\n for ( var l = 0; l< newOutput[k].length; l++) {\n newOutput[k][l] = 0;\n }\n }\n\n // Map the current result to the format desired\n // 7 rows were\n // row0 PixelName\n // row1 Width\n // row2 Height\n // row3 X\n // row4 Y\n // row5 Average\n // row6 Consecutive pixel name\n let firstRowIndex = 0;\n for (let rowIndex = 0; rowIndex < outputArray.length; rowIndex++) {\n const row = outputArray[rowIndex];\n for (let colIndex = 0; colIndex < row.length; colIndex++) {\n const col = row[colIndex];\n // Determine the name\n const pixelName = `${getLettherForRowNumber(rowIndex)}${colIndex}`;\n newOutput[0][firstRowIndex] = pixelName;\n newOutput[1][firstRowIndex] = FIELD_WIDTH ; // Width\n newOutput[2][firstRowIndex] = FIELD_HEIGTH; // Height\n newOutput[3][firstRowIndex] = colIndex * FIELD_WIDTH; // X\n newOutput[4][firstRowIndex] = rowIndex * FIELD_HEIGTH; // Y\n newOutput[5][firstRowIndex] = col; // Average\n // Determine the name 2\n const pixelName2 = `a${firstRowIndex}`;\n newOutput[6][firstRowIndex] = pixelName2;\n firstRowIndex++;\n }\n }\n\t\n\tmsg.payload = newOutput;\n\t\n return msg;\n\n\t\nfunction detectStartHeating(inputArray) {\n\t \n\t// Haet difference from cool row to first heated row, how much hotter does the first heated row to be ?\n \n const THRESHOLD = 5;\n\n var hotRow = 0 ;\n var currentRowAverage = calcRowAverage(inputArray, hotRow);\n hotRow++;\n \n var nextRowAverage = calcRowAverage(inputArray,hotRow);\n while( currentRowAverage + THRESHOLD > nextRowAverage && currentRowAverage > -1 && nextRowAverage > -1) {\n\n currentRowAverage = nextRowAverage;\n hotRow++;\n nextRowAverage = calcRowAverage(inputArray,hotRow);\n }\n if (nextRowAverage == -1 || currentRowAverage == -1) {\n return 0;\n } else {\n return hotRow;\n }\n }\n\nfunction detectEndHeating(inputArray) {\n // heat difference from cool row to first heated row , how much hotter does the first heated row have to on average?\n \n const THRESHOLD = 40;\n var hotRow = inputArray.length - 1;\n var currentRowAverage = calcRowAverage(inputArray, hotRow);\n hotRow--;\n\n var prevRowAverage = calcRowAverage(inputArray,hotRow);\n\n while ( currentRowAverage + THRESHOLD > prevRowAverage && currentRowAverage > -1 && prevRowAverage > -1 && hotRow>0) {\n currentRowAverage = prevRowAverage;\n hotRow--;\n prevRowAverage = calcRowAverage(inputArray,hotRow);\n \n }\n if( prevRowAverage == -2 || currentRowAverage == -1) {\n return 0 ;\n }\n\n else\n {\n return hotRow;\n }\n }\n \nfunction calcRowAverage(inputArray,row) {\n var res = 0;\n if (inputArray.length < row) {\n return -1;\n }\n\n\n for (var g = 0; g< inputArray[row].length; g++) {\n res += inputArray[row][g];\n }\n return res/inputArray[row].length;\n}\t \n\nfunction getLettherForRowNumber(rowNumber) {\n // ASCII code for 'a' is 97, 122 for 'z'\n if (rowNumber < 26) {\n return String.fromCharCode(97 + rowNumber);\n } else {\n const asciiFirstLetter = Math.round(rowNumber / 25) - 1;\n const mod = rowNumber % 25 - 1;\n const firstLetter = String.fromCharCode(97 + asciiFirstLetter);\n const secondLetter = String.fromCharCode(97 + mod);\n return `${firstLetter}${secondLetter}`;\n }\n}\n","outputs":1,"noerr":0,"x":730,"y":260,"wires":[["261a99d3.e937d6"]]},{"id":"ff81e701.9afc9","type":"ui_group","z":"","name":"control","tab":"891ab146.796e78","order":1,"disp":true,"width":"6","collapse":false},{"id":"891ab146.796e78","type":"ui_tab","z":"","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 08:13 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/4 "2019-11-20T08:13:32Z")

</div>

Can you check it now?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 08:53 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/5 "2019-11-20T08:53:54Z")

</div>

Please re-read the post I linked to and **edit** your post, don't post new replies.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 08:57 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/6 "2019-11-20T08:57:51Z")

</div>

Okay, I have edited as suggested.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 09:10 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/7 "2019-11-20T09:10:22Z")

</div>

Well I don't see it, select the nodes, export the code and post your flow as follows:

```  
your code  
```

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 09:12 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/8 "2019-11-20T09:12:34Z")

</div>

Is it fine now.I did as suggested.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 09:21 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/9 "2019-11-20T09:21:49Z")

</div>

Do the flow variables show up in the context data window ?

![32](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/00f065832881b5ebc2f507c289098bcba5e457c6.jpeg)

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 09:26 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/10 "2019-11-20T09:26:27Z")

</div>

How do i access this? The variables are seen in the UI and dashboard layout.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 09:31 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/11 "2019-11-20T09:31:26Z")

</div>

Click this arrow: context data.

 ![09](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/1/1150b45d11e109b975b174093813967e7b1f1410.jpeg)

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 09:37 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/12 "2019-11-20T09:37:31Z")

</div>

I am sorry I am very new to node red. I am not getting that arrow button nor do i see that context tab anywhere. Can you tell me how to see the context tab?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 09:40 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/13 "2019-11-20T09:40:52Z")

</div>

Please [watch this playlist](https://www.youtube.com/watch?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6&v=ksGeUD26Mw0) - video 7 is about the sidebar.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 09:54 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/14 "2019-11-20T09:54:27Z")

</div>

My side bar has only info and debug tab. No arrow mark is to be seen. I have attached the screen shot.

 ![context%20node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e1103dcfaac9673c427a48bcce8829fb67abc30b.png)

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 10:27 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/15 "2019-11-20T10:27:31Z")

</div>

That is strange, on which OS, what version of node-red, nodejs, npm are you running ? And which browser are you using ?

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 10:55 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/16 "2019-11-20T10:55:48Z")

</div>

It is running on the company server. Windows server 2016. The node red version is 0.18.4 and npm is 6.11.3 and node js is 12.12.0.I am using mozilla browser.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [20 November 2019 11:14 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/17 "2019-11-20T11:14:03Z")

</div>

> 0.18.4

I am not sure when context variables were introduced, but 0.18.4 is from Jan 2018. The context browser was introduced in 0.19 in Aug 2018.

---

<div class="post-metadata">

**Author:** ![varun](https://avatars.discourse-cdn.com/v4/letter/v/e9bcb4/32.png) [@varun](https://discourse.nodered.org/u/varun)\
**Post date:** [20 November 2019 11:38 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/18 "2019-11-20T11:38:32Z")

</div>

I need admin rights to update it, which i dont have as of now. Any other way to solve the problem?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 November 2019 14:37 UTC](https://discourse.nodered.org/t/error-in-dashboard-creation/18181/19 "2019-11-20T14:37:54Z")

</div>

Go to your boss and/or the IT guys and say "In order to do my job, I need node-red updated. What is running is an old release that will not work for what we are trying to do".
