Mimicking Python join to concatenate a list of dicts into a string
How would I do this?
e.g.
Data:
[
{
"datetime": 1747795200000,
"price": 108.64
},
{
"datetime": 1747795500000,
"price": 119.71819
},
{
"datetime": 1747795800000,
"price": 119.71819
},
{
"datetime": 1747796100000,
"price": 114.23557
}
]
Output:
"2025-05-21 10:30 - $108.64
2025-05-21 11:00 - $119.72
2025-05-21 11:30 - $119.72
2025-05-21 12:00 - $114.24"
Python equivalent:
"\r\n".join(
"{} - ${:.2f}".format(
system.date.format(system.date.fromMillis(row['datetime']), 'YYYY-MM-dd HH:mm'),
row['price'])
for row in value
)
[PS. this wiki was such a good idea]
List concat
groupConcat(
forEach(
{path.to.source.list},
stringFormat(
"%s - $%.f",
dateFormat(
fromMillis(it()['datetime']),
'yyyy-MM-dd HH:mm'
),
it()['price']
)
),
"\r\n"
)