Hmm... you could try using something like Object.values
on your query data to convert it into any array of message objects. That could be done, for instance, by adding a transformer to your query that looks something like:
return Object.values(data);
Which would turn your query data into something like
[
{
idCustomer: 5624196464,
messageBody: "Hola soy el cliente",
messageTime: 1669348678,
messageType: "text"
},
{
/* second message */
},
// ... etc
]
In that case, you could access each value using i
exactly the way you did in your first example (assuming this HTML component is in a listview).
If it's important to keep the keys as well, you can try Object.entries
instead:
return Object.entries(data);
Which would turn your data into something like:
[
[
849834389438943894383498439120921,
{
idCustomer: 5624196464,
messageBody: "Hola soy el cliente",
messageTime: 1669348678,
messageType: "text"
}
],
[
930983740192783491023741234,
{
/* second message */
}
],
// ... etc
]
That would in which case you'd access each value with something like
{{ Messages.data[i][1].idCustomer > '1' ...
That 1
would be fixed since the actual message object would always be the second object in its corresponding array.
Let me know if that helps!