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 / Action 'Apply_to_each'...
Power Automate
Unanswered

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

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

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 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard