cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimJim
Helper I
Helper I

Approval Flow - error with for each "is of type 'Object'. The result must be a valid array."

Hi Guys,

I have the following flow:

Screenshot 2021-05-17 112221.png

Which when tested returns error message: The execution of template action 'Start_approval' failed: the result of the evaluation of 'foreach' expression '@outputs('Get_approval')?['body']' is of type 'Object'. The result must be a valid array.

Get Approval is a Get Item command and returns a single list item using the ID, I am not sure how to return it as an array, or is there another method I should use?

Thanks 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Resident Rockstar
Resident Rockstar

@JimJim do you even need a foreach loop ? foreach loops expects an array as input so the error is correct. 

Try passing values instead of body if you need and I assume Get approval is get item which returns only one item if thats the case you can start approval directly after Check product criteria action.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
jinivthakkar
Resident Rockstar
Resident Rockstar

@JimJim do you even need a foreach loop ? foreach loops expects an array as input so the error is correct. 

Try passing values instead of body if you need and I assume Get approval is get item which returns only one item if thats the case you can start approval directly after Check product criteria action.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

JimJim
Helper I
Helper I

Hi @jinivthakkar ,

Thank you, I don't know how that for each loop got there, I maybe added it in error. I have removed the loop and it works 🙂 

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

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (48,712)