[
{
"RBLRefNo": "RBL2600",
"Frequency": 6
},
{
"RBLRefNo": "RBL2113",
"Frequency": 1
},
{
"RBLRefNo": "RBL1473",
"Frequency": 2
},
{
"RBLRefNo": "RBL2144",
"Frequency": 1
}
]
NOTE: Please consider AISRefNo = RBLRefNo and Count = Frequency for your case.
When you use Create HTML table action on FinalResult (from compose action), the below table will be produced:
If all failse, use expression with Compose: Make sure you’re outputting a string, not an object.
Inside the "Apply to each" loop, build each row, use a Compose action to build TableRows with an expression like:
concat('<tr><td>', items('Apply_to_each')?['AISRefNo'], '</td><td>', string(items('Apply_to_each')?['Count']), '</td></tr>')
This creates one HTML row per item.
Please note taht, you need to initialize an array varible like FinalResult at the start of your flow (at least before Apply to each loop). Let's say array variable name is TableRows, Type Array and value [].
After the loop, to collect a table, use the following expression in a Compose:
concat('<table border="1"><tr><th>AISRefNo</th><th>Count</th></tr>', join(variables('TableRows'), ''), '</table>')
This should produce a complete html table and you can use it in the email.