Skip to main content

Notifications

Power Automate - General Discussion
Answered

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

(0) ShareShare
ReportReport
Posted on by 289

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 🙂

  • JimJim Profile Picture
    JimJim 289 on at
    Re: Approval Flow - error with for each "is of type 'Object'. The result must be a valid array."

    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 🙂 

  • Verified answer
    jinivthakkar Profile Picture
    jinivthakkar 4,177 on at
    Re: Approval Flow - error with for each "is of type 'Object'. The result must be a valid array."

    @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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard