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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Action 'Apply_to_each'...
Power Automate
Answered

Action 'Apply_to_each' failed: '@body('Parse_JSON_-_ServicePrincipals')?['body']?['value']' is of type 'Null'. The result must be a valid array.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Dear Automators!

 

I'm in the process of building a power flow that sync all spn's and applications into a SharePoint list for automated review/attestation. 

I'm recieving the following error when the test is executed:

 

 

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@body('Parse_JSON_-_ServicePrincipals')?['body']?['value']' is of type 'Null'. The result must be a valid array.

 

 

 

Roko45_0-1684740113166.png


I even added the "Null" value in the schema to support null values besides strings - see below screendump:

Roko45_0-1684740474352.png

 



Anyone else experienced this before? 

Best regards,

Roko

 

Categories:
I have the same question (0)
  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Please consider to put your output from parse Json in to a "Initialize a variable" action to format it into a valid array.

    Or refer to below function to surround the outputs to format it directly:

    Reference guide for expression functions - Azure Logic Apps | Microsoft Learn

     

    Community Support Team _ Wenjuan Zou

    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 463

#1
Valantis Profile Picture

Valantis 463

#3
11manish Profile Picture

11manish 264

Last 30 days Overall leaderboard