Pass the array of the data as usual to the HTML component using: $w('#html1').postMessage(YourArrayName);
And in the HTML component, use this code:
<script type="text/javascript">
window.onmessage = (event) => {
if (event.data) {
const dataArray = event.data;
dataArray.forEach((obj, index) => {
// Iterate through the array and access each object
console.log(`Object ${index + 1}:`);
// Access properties of the object
console.log(`Property 1: ${obj.YourPropertyname}`);
console.log(`Property 2: ${obj.YourPropertyName}`);
// Add more properties as needed
});
}}
</script>
Just replace YourArrayName and YourPropertyName with appropriate values.