cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
esantos01
Regular Visitor

Creating a approval workflow where not all approvals are required.

I am trying to create an workflow where sometime only one approver is required to sign and the other approver will have a Null response as a value.

But I would like to have a single email with comments from approvers with those that approved and haven't.

 

Here is the error I am getting.

 

esantos01_1-1659454228215.png

The execution of template action 'Apply_to_each_(Comments_eMail)' failed: the result of the evaluation of 'foreach' expression '@body('Start_and_wait_for_an_approval_(IT)')?['responses']' is of type 'Null'. The result must be a valid array.

 

esantos01_0-1659454176996.png

esantos01_2-1659454281165.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @esantos01 ,

 

Could you please share more details about your scenario? It seems like there are logic problems in your flow. When IT is blank, why did you use the response of that approval? Do you have an approval chain to implement?

 

I assume there is no approval chain, to check the responses on which department is NULL, you will need to add three parallels, in each parallel use a Condition control to check on departments and start other approvals. If you will with a chance that have no department comments at all, there should be 4 parallels.

vjefferni_2-1659688949647.png

vjefferni_3-1659688957353.png

 

The array variable is used for temporarily store the comments from respective approval, so the expression of compose would be like:

join(outputs(variables('comments')),';')

 

Hope this helps.

 

Best regards,

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @esantos01 ,

 

Could you please share more details about your scenario? It seems like there are logic problems in your flow. When IT is blank, why did you use the response of that approval? Do you have an approval chain to implement?

 

I assume there is no approval chain, to check the responses on which department is NULL, you will need to add three parallels, in each parallel use a Condition control to check on departments and start other approvals. If you will with a chance that have no department comments at all, there should be 4 parallels.

vjefferni_2-1659688949647.png

vjefferni_3-1659688957353.png

 

The array variable is used for temporarily store the comments from respective approval, so the expression of compose would be like:

join(outputs(variables('comments')),';')

 

Hope this helps.

 

Best regards,

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

esantos01
Regular Visitor

Correct. I don't have an approval chain. I will try the parallel for Condition control as you suggested. 

Thank you!

Helpful resources

Announcements
Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,719)