timdows / MMM-JsonTable

A module for the MagicMirror project which creates a table filled with a list gathered from a json request.
MIT License
25 stars 31 forks source link

Numerical values displayed as "object" #3

Closed fiveseven808 closed 5 years ago

fiveseven808 commented 6 years ago

From the JSON data: [{"cid":"PWER","data":[{"1531345190000":345}],"sid":"743125","units":"kWm","age":6}]

I see the following displayed: PWER | [object Object] | 743125 | kWm | 6

Which is to say, way better than any of the other JSON modules (which don't seem to be able to parse my source at all)

I'm not very well versed in javascript and I was wondering if you could help me get that number "345" and make it possible to display?

That's my main goal. Having a weird format, and including a bunch of stuff I don't need is completely fine. I just want that number.

Thank you for making this!

timdows commented 6 years ago

It currently does not understand that the 'data' object (in this case an array with one object in it) should be parsed before displaying it.

Can you modify the json data so that it will return only?

[{"cid":"PWER","data":345,"sid":"743125","units":"kWm","age":6}]
timdows commented 5 years ago

Closed due to inactivity