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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / ExpressionEvaluationFa...
Power Automate
Unanswered

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each_9' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_5')?['body']?['items']' is of type 'Null'. The result must be a valid array.

(0) ShareShare
ReportReport
Posted on by 4

Hi, I am having issues with a flow that I have built, which is displaying the following error message:

 

ExpressionEvaluationFailed. The execution of template action 'Apply_to_each_9' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_5')?['body']?['items']' is of type 'Null'. The result must be a valid array.

 

ollyberry7_1-1707753303309.png

 

This is what the flow looks like:

 

ollyberry7_2-1707753406645.png

 

Essentially, the Parse JSON runs correctly, however the information is not populating the SharePoint List at all and skipping past these.

 

Is there a way to fix this? I have tried rebuilding, etc and nothing seems to be working...

 

Any repsonses appreicated, thank you in advance.

 

Olly

 

 

Categories:
I have the same question (0)
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at

    I think if you add a condition after your Parse JSON 5 action you will be all set. You'll want to set the condition to where the length of the body of the Parse JSON 5 action is greater than zero. The length expression counts how many items are in the array. According to the error, your array contains no values. By adding the condition, you can add the Apply to each action to the yes side of the condition when it contains items. The expression would be length(outputs('Parse_JSON_5))

  • ollyberry7 Profile Picture
    4 on at

    Hi David,

     

    Thank you for this.

     

    I have tried your suggestion and am now getting the following error:

     

    InvalidTemplate. Unable to process template language expressions for action 'Condition_5' at line '0' and column '0': 'The template language function 'length' expects its parameter to be an array or a string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#length for usage details.'.

     

    See below the error and the build:

     

    ollyberry7_0-1707822516955.png

     

    ollyberry7_1-1707822677786.png

    Does this look correct to you?

     

    Thank you for your help.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard