Iterate through array on notification

i am collicting a series of datasets into an array (basically thermostat settings and weather settings) so that i can see why one floor of the house is hot on certain days. the data collection works pretty well, but i was hoping i could email the data to myself decoding the array. for example, right now the data comes to me as


but i was hoping i could format it pretty on email by adding some new lines to each array element. it seems that the iterate function either doesn’t work on the body of the email or (more likely) i don’t know how to use the iterate function to push the data. i was trying this on the body of the notification:

{ iterate( dataArray, i + "\n", "i" ) }


The iterate() function will still produce an array/table, and that doesn’t help you get to message text. What you are almost doing in your attempt (and good effort, by the way) is the core of the join() function. The join() function takes an array and a separator and makes a string of the array elements using the separator given in between them.

You should be able to do { join( dataArray, "\n" ) } for the email message string and get a result closer to what you are looking for, I think.


as always, @rigpapa to the rescue! had to do a bit of stringify and unstringify magic as the value was being fetched from another reactor, but that certainly did the trick. thank you!

1 Like

Best Home Automation shopping experience. Shop at getvera!

© 2020 Vera Control Ltd., All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules