The element of an array name has a period in the name. "pm2.5_10minute"

Any suggestions on how to get the value of the second object?

object {

  • pm2.5: 0.8*
  • pm2.5_10minute: 0.7*
  • pm2.5_30minute: 0.6*
  • pm2.5_60minute: 0.6*
  • pm2.5_6hour: 1.6*
  • pm2.5_24hour: 3*
  • pm2.5_1week: 3.5*

Purple Air has problematic JSON naming, which make parsing difficult.

Use bracket notation

Better still use the tools node-red provides - IE the "copy path" button...

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.


Works perfectly. I have been Googling and reading the forums for the last half an hour with no clear path.

So simple, thank you again.

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