Im struggling with to build the email body from the compose action output.
I tried different way using select, union, but could no get any results.
so the output of the compose looks like this:
[
{
"borderID": "1",
"hour": "2025-10-02 00:00:00 - 2025-10-02 01:00:00"
},
{
"borderID": "1",
"hour": "2025-10-02 01:00:00 - 2025-10-02 02:00:00"
},
{
"borderID": "1",
"hour": "2025-10-02 02:00:00 - 2025-10-02 03:00:00"
},
{
"borderID": "2",
"hour": "2025-10-02 00:00:00 - 2025-10-02 01:00:00"
},
{
"borderID": "2",
"hour": "2025-10-02 01:00:00 - 2025-10-02 02:00:00"
},
{
"borderID": "2",
"hour": "2025-10-02 02:00:00 - 2025-10-02 03:00:00"
}
]
Note that I will always have the boredID 1 and borderID 2. My goal is to produce the email body like this
For borderID = 1, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 00:00:00 - 2025-10-02 01:00:00
• 2025-10-02 01:00:00 - 2025-10-02 02:00:00
• 2025-10-02 02:00:00 - 2025-10-02 03:00:00
For borderID = 2, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 00:00:00 - 2025-10-02 01:00:00
• 2025-10-02 01:00:00 - 2025-10-02 02:00:00
• 2025-10-02 02:00:00 - 2025-10-02 03:00:00
My current logic app looks like this enter image description here
and producing the output like this
{"":"For borderID = 1, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 00:00:00 - 2025-10-02 01:00:00"}
{"":"For borderID = 1, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 01:00:00 - 2025-10-02 02:00:00"}
{"":"For borderID = 1, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 02:00:00 - 2025-10-02 03:00:00"}
{"":"For borderID = 2, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 00:00:00 - 2025-10-02 01:00:00"}
{"":"For borderID = 2, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 01:00:00 - 2025-10-02 02:00:00"}
{"":"For borderID = 2, results.
The following hourly intervals exceeded the threshold:
• 2025-10-02 02:00:00 - 2025-10-02 03:00:00"}