cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
v-bacao-msft
Community Support
Community Support

 

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

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
v-bacao-msft
Community Support
Community Support

 

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

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

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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,975)