@jsanjurr
You need a Select and Filter Array action to get your count of items.
Select Action – Devops Query
Add a Select action to your flow and insert the outputs from the Azure Devops query. For my example I'm using a SharePoint list. The concept is the same.
Click the icon, to change from Map to text mode.

Get Team Names
Add a Get Items action to return the items from your Team list. Select action to grab the Team name from your list and an Apply to Each action to loop through each team.
For this select action, you will need to use the Map mode. You will need the SP Item ID to update the item.

Apply to Each – Team Name
Add an Apply to Each action. This action will loop through each Team name returned. Insert the outputs from the Select action that contains the array of Team Names and their respective SP ID.
I've added a Compose action as well to store the Team name as you'll need it in the next action.
I used an expression:
item()?['Team Name']
If your Select action key is different, you'll need to replace Team Name with your key text.

Filter Array
Add the Filter Array action into the Apply to Each action. In the From field, insert the outputs from the Select action that you used on the Azure Devops outputs.
In the first value field, insert an expression to access the content.
item()
Change the operator to contains.
In the second value field, insert an expression (or in my case— I've inserted the outputs from above that contain the Team name.

Add a Compose action below the Filter Array action and use the length() function to return the count from the Filter Array action. Insert the Body outputs from the Filter Array action.

Condition – Check Count
Add a Condition action to check the count of the items returned. If the count is greater than zero, add the Update Item or Create Item action into the Yes branch.
This way, the Update Item action will only run if there are items returned from the Filter Array action.

Update Item
Ensure you are using the content from the Filter Array action in your Update Item action. You will need to use an expression to access this content. This YT Short covers how to do that.

Hope this helps!
If I helped you solve your problem—please mark my post as a solution ✅. Consider giving me a 👍 if you liked my response!
|