I know that this is a very late response to this, but I have two answers for you.
Before I get to them, this kind of thing would usually need a bit more information / context to be edited into the question. Like, for example, which action is providing the information that you're looking for, and suchlike ... but I'll assume the HTTP Webhook one.
Answer 1 - Use The Approvals System
This provides the functionality that you're trying to get out of your emails, and is way easier to leverage in Power Automate / Logic Apps.
Answer 2 - Use The result()
Function
You should be able to leverage the result()
function within a filter action's 'From' field on the 'For each' then filter to the item()?['name']
which matches the action that you'd like to collate information on.
It should be noted that it only really works scoped actions that are NOT an 'Until' action (I think this is a bug) which will only output the final loop result.
I will try to bring you a proper 'solution' for this, if I have the time, however a basic solution is:
That second Select action should contain an array that takes data from every looped iteration of the 'HTTP Webhook' action.
I will attempt to see if I can provide a pastable version of this, as I constructed it very quickly in Power Automate, but appreciate that you'd want it in Logic Apps. If I can do that swiftly, I'll edit this.
Either way, here are the values used in each of the key fields:
FilterToHttpWebHookActionsOnlyArrCNST
Field | Value |
---|---|
From | result('For_each_approver') |
Condition Left | item()?['name'] |
Condition Right | HTTP_Webhook |
SelectOnlyCorrelationIdAndDecisionsArrCNST
Field | Value |
---|---|
From | range(0, length(body('FilterToHttpWebHookActionsOnlyArrCNST')[0]?['outputs'])) |
Map | See Below |
addProperty(
addProperty(
json('{}'),
'CorrelationId',
body('FilterToHttpWebHookActionsOnlyArrCNST')[0]?['outputs'][item()]?['inputs/body/YourCorrelationIdKeyNameGoesHere']
),
'Decision',
body('FilterToHttpWebHookActionsOnlyArrCNST')[0]?['outputs'][item()]?['outputs/body/YourDecisionKeyNameGoesHere']
)
I have made a lot of guesses above ... but hopefully you can glean that if you replace 'YourCorrelationIdKeyNameGoesHere
' with whatever the path to your actual CorrelationId is ... and similar for the output 'YourDecisionKeyNameGoesHere
' decision path ... you will have an array of results to play with.Now ... of course ... you also have to prep for errors. ;)