Hi @Anonymous,
A bit of a delayed response. But managed to create a flow which can select both the activities and days off into one row, which prevents it going into a nested loop. I have used xml, xpath and join functions for this.
Below is an example
1. Send an HTTP request to Azure DevOps, which used the URI
https://learn.microsoft.com/en-us/rest/api/azure/devops/work/capacities/get-capacities-with-identity-ref-and-totals?view=azure-devops-rest-7.2
@{variables('Project')}/_apis/work/teamsettings/iterations/@{variables('IterationId')}/capacities?api-version=7.2-preview.3
2. Filter Array From
outputs('Send_an_HTTP_request_to_Azure_DevOps')?['body']['teamMembers']
3. Filter Array Criteria
@greater(length(item()['daysOff']), 0)
4. Compose action which is used to convert the json into XML (makes it easier to retrieve fields from nested arrays).
xml(json(concat('{"root": { value:', body('Filter_Array'), '}}')))
5. Select From
xpath(outputs('XML'), '//root/value')
6. Select Map (switched to text mode with button on the right side)
{
"Name": @{xpath(item(), 'string(//teamMember/displayName/text())')},
"Days Off": @{join(xpath(item(), '//daysOff/start/text()'), ', ')},
"Activity Name": @{join(xpath(item(), '//activities/name/text()'), ', ')},
"Activity Capacity per Day": @{join(xpath(item(), '//activities/capacityPerDay/text()'), ', ')}
}
