# Display the content of object in ui template

**URL:** <https://discourse.nodered.org/t/display-the-content-of-object-in-ui-template/49619>\
**Category:** Dashboard\
**Created:** [11 August 2021 15:09 UTC](https://discourse.nodered.org/t/display-the-content-of-object-in-ui-template/49619 "2021-08-11T15:09:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oualid](https://avatars.discourse-cdn.com/v4/letter/o/8dc957/32.png) [@oualid](https://discourse.nodered.org/u/oualid)\
**Post date:** [11 August 2021 15:09 UTC](https://discourse.nodered.org/t/display-the-content-of-object-in-ui-template/49619/1 "2021-08-11T15:09:11Z")

</div>

hi,

i am using the `opcua` event node to catch the fake alarms and events, generated from `OPCUA server`, and display them on the table in `ui template`.  
the problem is not think appear in the `ui template` even i typed the below commands:

```auto
<table>
    <tr ng-repeat="(key, value) in msg.payload">
        <td>{{key}}</td>
        <td>{{value}}</td>
    </tr>
</table>

```

or

```auto
<table>
    <tr">
        <td>{{msg.payload.EventID}}</td>
    </tr>
</table>

```

or

```auto
<table>
    <tr">
        <td>{{msg.payload[0].EventID}}</td>
    </tr>
</table>

```

the below screen shot shows the content of the object

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/2/2227f9699ccf355dfe74a8dd41ab70b84c8f962c.png)

could you please help me  
thank you

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [11 August 2021 16:31 UTC](https://discourse.nodered.org/t/display-the-content-of-object-in-ui-template/49619/2 "2021-08-11T16:31:27Z")

</div>

> [@oualid](#):
>
> ```auto
> <table>
> <tr>
> <td>{{msg.payload.EventID}}</td>
> </tr>
> </table>
> 
> ```

This syntax seems correct but `EventID` should be `EventId`

The 1st and 3rd example code could be used if the `msg.payload` was an array.

**[EDIT]**  
You could also convert your payload object into an iterable array. Example :

```auto
[{"id":"dd281f4b964c7c96","type":"ui_template","z":"4895ea10b4ee9ead","group":"fe8bd71ec6128157","name":"table","order":1,"width":"29","height":"10","format":"<table>\n\n <tr ng-repeat=\"el in msg.payload\">\n <td>{{el[0]}}</td>\n <td>{{el[1]}}</td>\n </tr>\n\n</table>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":730,"y":780,"wires":[[]]},{"id":"095465e919b45cd3","type":"inject","z":"4895ea10b4ee9ead","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"Event Type\":\"piezo1se\",\"EventId\":\"0xa34cb1be7168baaf0asbb29c2£9ab2500000002\",\"SourceName\":\"Condition1\",\"Time\":\"2021-08-11714:57:02.1072\",\"ReceiveTime\":\"2021-08-11T14:52.2522\",\"Message\":\"Alarm Message created by oualia\",\"Severity\":800,\"ConditionName\":\"Error\",\"Retain\":true,\"EnabledState\":\"Enabled\",\"StatusText\":\"Good (0x00000)\",\"LastSeverity\":0,\"Comment\":\"Initialized\",\"AckedState\":\"Unacknowledged\",\"ActiveState\":\"Inactive\"}","payloadType":"json","x":250,"y":780,"wires":[["667fc249772d1731","0d4e1d868735e05b"]]},{"id":"667fc249772d1731","type":"debug","z":"4895ea10b4ee9ead","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":340,"y":720,"wires":[]},{"id":"0d4e1d868735e05b","type":"function","z":"4895ea10b4ee9ead","name":"","func":"msg.payload = Object.entries(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":780,"wires":[["dd281f4b964c7c96","d4fe41fc807c4972"]]},{"id":"d4fe41fc807c4972","type":"debug","z":"4895ea10b4ee9ead","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":590,"y":720,"wires":[]},{"id":"fe8bd71ec6128157","type":"ui_group","name":"Table","tab":"ff25ab1d26c005a4","order":1,"disp":true,"width":"30","collapse":false},{"id":"ff25ab1d26c005a4","type":"ui_tab","name":"Table","icon":"dashboard","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:** [25 August 2021 16:31 UTC](https://discourse.nodered.org/t/display-the-content-of-object-in-ui-template/49619/3 "2021-08-25T16:31:42Z")

</div>

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