cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeKi72
Post Patron
Post Patron

Error: Apply to each is of type Object. The result must be a valid array.

Dear Experts, 

I try to read a sharepoint managed metadata column for a keyword. But i get this error-message:

The execution of template action 'Apply_to_each_2' failed: the result of the evaluation of 'foreach' expression '@items('Apply_to_each')' is of type 'Object'. The result must be a valid array.

 

This is my flow:

 

PeKi72_0-1657003840170.png

Gr. P

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @PeKi72 ,

the error message tells you that the input of 'Apply to each 2' is wrong. On the first look it seems to me that Power Automate messed up the input of that action. I'd try to remove the 'Apply to each 2' and the 'Send an HTTP request...' actions and add them again, that might fix it.

The problem is that the input of 'Apply to each 2' shouldn't be the 'Current item' (as that's the currently processed SP item = an object, not an array), it must be always an array e.g. a SharePoint multiple selection column, probably the 'Keywords'.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

1 REPLY 1
tom_riha
Super User
Super User

Hello @PeKi72 ,

the error message tells you that the input of 'Apply to each 2' is wrong. On the first look it seems to me that Power Automate messed up the input of that action. I'd try to remove the 'Apply to each 2' and the 'Send an HTTP request...' actions and add them again, that might fix it.

The problem is that the input of 'Apply to each 2' shouldn't be the 'Current item' (as that's the currently processed SP item = an object, not an array), it must be always an array e.g. a SharePoint multiple selection column, probably the 'Keywords'.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,387)