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

Repeat Approval until Outcome is "Approve"

Dear community,

 

i've seen you helping in many situations and today it's my turn to ask for your help.

 

I'm trying to do the following:

  1. When a new file is created in a SharePoint folder
  2. Start an approval workflow for this file and wait for answer
  3. Repeat the Approval Workflow until the outcome is "Approve"

 

This would be the start to a few further steps but it is already failing with this message: 
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body/ID']' is of type 'Integer'. The result must be a valid array.

 

Here's my configuration:

FloTob_0-1597068234828.png

FloTob_1-1597068276824.png

 



1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @FloTob,

 

The Apply to each action is an action to loop an array, and the ID is a number, so the error happened.

It seems like you want to make the Flow keep running until the approval response is approve, I recommend you not to add the Apply to each, just need a Do Until, here is a simple instance:

Annotation 2020-08-11 133915.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

4 REPLIES 4
PrasadAthalye
Super User
Super User

Under apply to each, you have used ID... Instead, can you use list of items?

 

PrasadAthalye_0-1597075801995.png

 

Please mark it as answer if this solves your problem.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
v-litu-msft
Community Support
Community Support

Hi @FloTob,

 

The Apply to each action is an action to loop an array, and the ID is a number, so the error happened.

It seems like you want to make the Flow keep running until the approval response is approve, I recommend you not to add the Apply to each, just need a Do Until, here is a simple instance:

Annotation 2020-08-11 133915.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

@PrasadAthalye , I wasn't able to choose "List of items", so this could not solve the problem, but thanks a lot!

@v-litu-msft thank you so much, this finally works out! 

 

Great community and fast help!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,394)