cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Brian-Cape
Frequent Visitor

Testing for work item children

I'm attempting to write a flow that will check a work item when it is "Committed" and check if it has any children, if it does do task 1, if it does not do task 2.

 

How do I check if a work item has children?

 

The Action "Get work item children" will error out if there are no children on the work item (instead of returning an array of zero items.) Is there another way to do this check?

 

A snapshot of the flow is below.

 

Flow.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support
Community Support

Re: Testing for work item children

 

Hi @Brian-Cape ,

 

You could use Configure run after to implement your needs.

Add a parallel branch, one branch is only executed when the Get work item children action runs successfully, and the other branch is executed when the Get work item children to fail.

Image reference:

94.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Brian-Cape
Frequent Visitor

Re: Testing for work item children

Working through the previous solution, I was able to force a positive result with the Terminate Action.

Thanks for the help @v-bacao-msft 

 

Flow-Error-Override.png

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: Testing for work item children

 

Hi @Brian-Cape ,

 

You could use Configure run after to implement your needs.

Add a parallel branch, one branch is only executed when the Get work item children action runs successfully, and the other branch is executed when the Get work item children to fail.

Image reference:

94.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Brian-Cape
Frequent Visitor

Re: Testing for work item children

Thanks @v-bacao-msft , that does work with a but.

 

The flow will report as failed with this pattern. I can get past the error and continue processing, but it would be nice if Flow would not report a failure since we do end on a success, is there a setting for this I'm missing?

 

I think I found a convoluted alternative (but it will add a bunch more actions) where I get the work item detail via http request, expand the relationships, check if the relationships is a property on the object, if they are, check if any of the relationships are children (we don't care about parent, related, etc...) and then perform Task 1 or Task 2.

 

Flow-Error.png

Brian-Cape
Frequent Visitor

Re: Testing for work item children

Working through the previous solution, I was able to force a positive result with the Terminate Action.

Thanks for the help @v-bacao-msft 

 

Flow-Error-Override.png

View solution in original post

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,052)