Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

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

 

  • Verified answer
    v-wenjuan-msft Profile Picture
    Microsoft Employee on at
    Re: Action 'Apply_to_each' failed: '@body('Parse_JSON_-_ServicePrincipals')?['body']?['value']' is of type 'Null'. The result must be a valid array.

    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow