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 / Apply to each failure ...
Power Automate
Answered

Apply to each failure foreach is of type Null

(0) ShareShare
ReportReport
Posted on by 11

I have a flow built by a 3rd party. Needless to say, they are not responding for assistance in fixing the issue. 

Error generated on a Apply to Each - The flow is for Purchase Requests. The error is during the Send Notification step at the end of the flow - after checking the status of the purchase request, then checks to see if the Send Email variable is true - if so, then condition check and looks at the update item 3 step using the CC.. Email field. This is a non mandatory field that subsequently in the apply to each fails with the foreach expression is of type Null - must be a valid array. I've seen other articles implying there should be a empty variable and then using the coalesce function so an empty value does not create the error.

If that's the fix - where should it go?

kevinbryan_0-1679672782950.png

 

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @kevinbryan ,

    In the condition are you checking the length of the array?

    Can you share the expression, please?

     

  • kevinbryan Profile Picture
    11 on at

    Yes - checking to see if there are Attachments (array) to determine yes/no

    Condition 2 - length(variables('Attachments')) is not equal to 0 

     

  • Verified answer
    kevinbryan Profile Picture
    11 on at

    With the help from a generous person in Australia, he suggested that there was no need for the apply to each and had me remove them and reconfigure to just the send notifications after the condition. Is fixed now. 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard