web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : FdMVjY6YuoTsAP6Esqfk9s
Power Automate - Building Flows
Answered

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

Like (0) ShareShare
ReportReport
Posted on 27 Aug 2020 15:12:37 by 44

Hi All,

 

I keep getting this error.

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

I have not changed anything in my columns.

 

Please help!

  • abekhouche Profile Picture
    13 on 12 Jun 2023 at 11:48:32
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    abekhouche_0-1686570388622.png

    how i can put 2 output in my loop for take the 2 json format?
    I think this error is here for that.

    abekhouche_1-1686570505456.png

     

  • Community Power Platform Member Profile Picture
    on 05 Dec 2022 at 10:52:48
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    looks like you are trying to perform an action for arrays using a string variable. You can convert a string to an array just by using the array(<variable>) function as an expression with your <variable> [DUEDATE..]

    or createArray(split(<variable>,'<separator>')) if your variable contains more than one element [DUEDATE..]

  • Efe_Ildem Profile Picture
    9 on 07 Nov 2022 at 08:58:25
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    flow.png

    flow2.png

    I have this similar problem. I am new at Power Automate. Please I am working to fix this for long time. Thanks

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on 28 Aug 2020 at 08:46:16
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    @Mamzy Ahh OK the Flow was Corrupt. I am glad that the problem has been resolved. 

     

    Have a wonderful weekend đꙂ

  • Verified answer
    Mamzy Profile Picture
    44 on 28 Aug 2020 at 08:43:16
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    Hi @CFernandes,

     

    I ended up having to recreate the flows again and this seemed to solve the problem.

     

    Thanks

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on 27 Aug 2020 at 17:20:51
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    @Mamzy 

     

    I am not sure if this will work but worth a try, just decorate the 'Team Owner' with array() function. 

     

    Untitled.png

     

  • Mamzy Profile Picture
    44 on 27 Aug 2020 at 15:56:17
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    Hi Yes it returns an array.

     

    It seems something has happened to the term owner column that was originally created.

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on 27 Aug 2020 at 15:53:03
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    @Mamzy Can you confirm if 'Team Owner' property returns an array.

     

    Add a compose action and add the 'Team Owner' property to it. See if a Apply to each loop gets added around it automatically. I have a feeling 'Team Owner property is not an array,

     

     

  • Mamzy Profile Picture
    44 on 27 Aug 2020 at 15:28:01
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    hi @CFernandes ,

     

    Here you go.

     

    Mamzy_0-1598542069141.png

     

  • CFernandes Profile Picture
    8,295 Most Valuable Professional on 27 Aug 2020 at 15:20:13
    Re: The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'. The result must be a valid array.

    @Mamzy The result must be a valid array.

     

    '@outputs('Update_item')?['body/TermOwner']' is of type 'Object'.

     

    Please share the screenshot of your Power Automate(Flow) so that we can assist you better.

     

     

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete