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 Automate
Unanswered

Apply to each issue

(0) ShareShare
ReportReport
Posted on by 708

Hello,

 

I am receiving the following error when i run my flow:

 

The execution of template action 'Apply_to_each_4' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['AdminServices']' is of type 'Null'. The result must be a valid array.

 

I have initialize Variable type as string before it gets to this step and other variable and apply to each similar to the AdminServices which runs before hand with no issues.  It gets stuck at the adminservices section even though this field in the SP List is set up exactly the same as the previous steps.

 

This is the step that is causing the issues:

 

neill_long_0-1632145011070.png

would anyone have any advice on how i can fix this please?

 

thanks

Alistair

Categories:
I have the same question (0)
  • eric-cheng Profile Picture
    5,171 on at

    Hi @neill_long ,

     

    Looks like AdminServices is empty?  Can you add a Compose action prior to your loop and confirm the output? 

     

    You can add a condition to check if empty(triggerBody()?['AdminServices']) is true or not and only loop when it is false.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

  • neill_long Profile Picture
    708 on at

    Hi @eric-cheng 

     

    It is empty but I have also tested it where there was data in the field and still got the same message.

     

    I put a Compose prior to it and the output was empty, but i dont understand why it worked on the step before for LearnerEngage.  This is a similar field in the same SP List and it was empty too.  

     

    Would there be a setting on the field in the SP List that i am missing that it doesn't recognise it?  The error message mentions a valid array, but the initialize variable i have specified as string

     

     

  • eric-cheng Profile Picture
    5,171 on at

    Hi @neill_long ,

     

    Can you screenshot the field settings in SharePoint for both fields?

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

  • neill_long Profile Picture
    708 on at

    Hi @eric-cheng 

     

    It was me being stupid, I had set the choice fields in the SP list slightly differently.  should have allowed multiple responses but hadn't selected that option.

     

    thanks for your help, it's now working

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard