cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

requirement of "Apply to each" for setting a variable

We are using a flow with variables and a lot of approvals. The flow was running fine for several months.

It includes several approvals and after each approval a variable has to be set. When the flow was created an "Apply to each" task was required to fill the variable after the approval with the comment of the approver. Since some weeks those apply to each actions failed, when the comment was empty. This wasn't a problem before. Now the flow fails, when the comment is left empty, with the attached error. But also the Apply to each is no longer required for setting the variable after an approval, so I removed all "Apply to each" actions in this flow and filled the variable directly afterwards.

I'd like to know after all where those changes are documented, to keep our buisness processes running without interruptions.

picture.png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: requirement of "Apply to each" for setting a variable

Hi @Anonymous,

 

Could you please share a screenshot of the configuration of your flow?

What has changed in your flow so the flow run failed?

 

I see that you have a expression @body('Start_an_approval')?['responses'] in your flow, so I guess you have set the Approval type of "Everyone from the assigned list", do you change the Approval type in your flow to "Anyone from the assigned list"? the expression @body('Start_an_approval')?['responses'] would only work for Approval type of "Everyone from the assigned list", If you change the the Approval type in your flow to "Anyone from the assigned list", the expression @body('Start_an_approval')?['responses'] wouldn't work.

 

I have made a test on my side to create a flow as below:

Capture.PNG

 

The flow would run failed with the same error as you as below:

Capture.PNG

 

So please check your flow and please create two different flow if you would needs Approval type of "Everyone from the assigned list" and "Anyone from the assigned list".

 

Best regards,

Alice

 

View solution in original post

1 REPLY 1
Community Support Team
Community Support Team

Re: requirement of "Apply to each" for setting a variable

Hi @Anonymous,

 

Could you please share a screenshot of the configuration of your flow?

What has changed in your flow so the flow run failed?

 

I see that you have a expression @body('Start_an_approval')?['responses'] in your flow, so I guess you have set the Approval type of "Everyone from the assigned list", do you change the Approval type in your flow to "Anyone from the assigned list"? the expression @body('Start_an_approval')?['responses'] would only work for Approval type of "Everyone from the assigned list", If you change the the Approval type in your flow to "Anyone from the assigned list", the expression @body('Start_an_approval')?['responses'] wouldn't work.

 

I have made a test on my side to create a flow as below:

Capture.PNG

 

The flow would run failed with the same error as you as below:

Capture.PNG

 

So please check your flow and please create two different flow if you would needs Approval type of "Everyone from the assigned list" and "Anyone from the assigned list".

 

Best regards,

Alice

 

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,059)