# Table alarm on dashboard

**URL:** <https://discourse.nodered.org/t/table-alarm-on-dashboard/46167>\
**Category:** Dashboard\
**Created:** [24 May 2021 16:00 UTC](https://discourse.nodered.org/t/table-alarm-on-dashboard/46167 "2021-05-24T16:00:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandautism](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@grandautism](https://discourse.nodered.org/u/grandautism)\
**Post date:** [24 May 2021 16:00 UTC](https://discourse.nodered.org/t/table-alarm-on-dashboard/46167/1 "2021-05-24T16:00:47Z")

</div>

hello, i want to create an alarm table but i can not found how to design it, also I want to display the date of the alarm but it displays the date in real time, as it appears twice, I don't know why  
if anyone can help me I will be grateful

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/7/f7f4a0c78eb5addbf0b299802e385d4c08bb75ea.png)

```auto
[{"id":"b2b27f11.74dbe","type":"function","z":"4aea35b2.b0688c","name":"","func":"const offset = 1; //CMT+0\nvar dh = new Date( new Date().getTime() + offset * 3600 * 1000);\nlet t = new Date(dh).toJSON().slice(0, 19).replace('T', ' ');\nlet keys = Object.keys(msg.payload);\nlet values = Object.values(msg.payload);\nlet arr = [];\n\nkeys.forEach((el, index) => {\n \n if (values[index]) { // if alarm true\n arr.push({\n title: keys[index],\n value: values[index],\n Time: t\n \n }) \n } // end of if\n \n})\n\n// sorting alphabetically // needs testing\n/*arr.sort(function(a, b) {\n var titleA = a.title.toUpperCase(); // ignore upper and lowercase\n var titleB = b.title.toUpperCase(); // ignore upper and lowercase\n if (titleA < titleB) {\n return -1;\n }\n if (titleA > titleB) {\n return 1;\n }\n\n // title must be equal\n return 0;\n});\n\n*/\nmsg.payload = arr;\n//msg.payload = [arr, Time];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":680,"wires":[["92ed6d5a.e101a8","c2988d9.3c7be7","c7a9d042.af62b","269ff2f5.36785e"]]},{"id":"c7a9d042.af62b","type":"ui_template","z":"4aea35b2.b0688c","group":"d8c473c2.474058","name":"Active Alarm","order":1,"width":0,"height":0,"format":"<style scoped>\n table {margin-bottom:180px}\n td {font-weight:800; padding-right:100px;}\n</style>\n\n<table id=\"table\" border=\"0.5\">\n<tr>\n<td>Title</td>\n<td>Status</td>\n<td>Time</td>\n</tr>\n<tr ng-repeat=\"alarm in msg.payload\">\n <td ng-if=\"alarm.value='true'\">{{alarm.title}}</td>\n <td ng-if=\"alarm.value='true'\">{{alarm.value}}</td>\n <td ng-if=\"alarm.value='true'\">{{alarm.Time}}</td>\n <td>{{alarm.title}}</td>\n <td>{{alarm.value}}</td>\n <td>{{alarm.Time}}</td>\n</tr>\n</table>\n\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":1090,"y":680,"wires":[[]]},{"id":"d8c473c2.474058","type":"ui_group","name":"List","tab":"d463fbe2.68b3c8","order":2,"disp":true,"width":12,"collapse":false},{"id":"d463fbe2.68b3c8","type":"ui_tab","name":"Alarmes","icon":"report_problem","order":7,"disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 June 2021 16:00 UTC](https://discourse.nodered.org/t/table-alarm-on-dashboard/46167/2 "2021-06-23T16:00:59Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
