# Accessing the name of a JSON property in template node

**URL:** <https://discourse.nodered.org/t/accessing-the-name-of-a-json-property-in-template-node/7584>\
**Category:** Dashboard\
**Created:** [4 February 2019 14:25 UTC](https://discourse.nodered.org/t/accessing-the-name-of-a-json-property-in-template-node/7584 "2019-02-04T14:25:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DillonJ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dillonj/32/5678_2.png) [@DillonJ](https://discourse.nodered.org/u/DillonJ)\
**Post date:** [4 February 2019 14:25 UTC](https://discourse.nodered.org/t/accessing-the-name-of-a-json-property-in-template-node/7584/1 "2019-02-04T14:25:26Z")

</div>

Hi folks,

I have an ESP8266 connected to a PZEM 004 sending messages with power readings...

Here is the structure of the JSON object:

```auto
object
Time: "2019-02-04T15:18:15"
ENERGY: object
TotalStartTime: "2019-02-03T09:46:57"
Total: 72.269
Yesterday: 15.613
Today: 56.656
Period: 24
Power: 2920
ApparentPower: 2939
ReactivePower: 336
Factor: 0.99
Voltage: 238
Current: 12.35

```

I am trying to display this data in a simple table, but I would like to do it without assuming the names of the various fields.... how can I do this? Something like this for example, which works in that I see the list of values, but I can't find a way to access the property names

```auto
<div layout="row" layout-align="start center">
  <span flex>Quantity</span>
  <span flex>Value</span>
</div>
<div layout="row" layout-align="start center" ng-repeat="ENERGY in msg.payload.ENERGY">
  <span flex style="color: green">{{ENERGY.name}}</span>
  <span flex style="color: red">{{ENERGY}}</span>
</div>

```

Can anyone help?

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [4 February 2019 18:01 UTC](https://discourse.nodered.org/t/accessing-the-name-of-a-json-property-in-template-node/7584/2 "2019-02-04T18:01:08Z")

</div>

It would help if you provide a valid JSON dataset for testing purposes. The JSON you posted is not valid and we can not guess what is the object that is nested in the property energy.
