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
Unanswered

Action 'Apply_to_each' failed

(0) ShareShare
ReportReport
Posted on by 7

Hi 

I have set up a from that allows user a choice of what service they require from us. Do they want to retrieve records from our warehouse or do they want us to collect records to store for them. If they want us to collect records we ask them to attach a template to the form of the records we need to collect.

I have set up a flow where when a form is submitted the data populates a request List (set up in Microsoft Lists) and then there is an action to add the template. All seems to be working well and data is populating the list, however I am getting the above error message when staff select the retrieve option and don't have to attach a template to the request. Is there a way of making the flow just apply this action when collection is selected?

 

Error message

The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@json(outputs('Get_response_details')?['body/r880f970ae6954f689189a39c62458eb7'])' is of type 'Null'. The result must be a valid array.

 

Thank you 

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @AndyW123 

     

    to be clear, some data is entered in forms with file (template) attached to the form, the flow should create list item for that data entered along with template file attached.

     

    am i right ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • AndyW123 Profile Picture
    7 on at

    Yes @Nived_Nambiar some data returns through the form will have the template attached and some will not have a template attached.

    It is the ones without the attached template that i am getting the error response on

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @AndyW123 

     

    could you share a screenshot of your flow, that would be helpful 🙂

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • AndyW123 Profile Picture
    7 on at

    Hopefully this is what you were looking for

     

    AndyW123_0-1701968678701.png

     

     

     

     
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @AndyW123 

     

    Show me the dynamic content on which you are looping ?

     

    I think you have to add a condition which checks whether the looping item has null value or not ?

     

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

  • AndyW123 Profile Picture
    7 on at

    hi @Nived_Nambiar 

    i think you could be right, my flow is asking to select something every time even though there is no file there every time.  is there a action i can add to correct this?

     

    AndyW123_0-1702284634449.png

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @AndyW123 

     

    May be you can use below condition to check whether the dynamic content is null or not?

    Like below :

    Nived_Nambiar_0-1702308785929.png

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 921

#2
Valantis Profile Picture

Valantis 801

#3
Haque Profile Picture

Haque 588

Last 30 days Overall leaderboard