cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NajukHusky
Regular Visitor

For each action ActionFailed. Fehler bei einer Aktion. Abhängige Aktionen wurden nicht erfolgreich durchgeführt.

Hi, my flow should read out for all my enciroments the flows created and existing. Result should be mailed to myself.

For Each Array as added by PowerAutomate while proofing the flow, test result shows Error:

Fehler beim Ausführen der Vorlagenaktion "Auf_alle_anwenden_2". Das Ergebnis der Auswertung des foreach-Ausdrucks "@items('Auf_alle_anwenden')" weist den Typ "Object" auf. Das Ergebnis muss ein gültiges Array sein.

NajukHusky_0-1622468478051.png

Any Idea what to change?

KR Carsten

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

If you want only one email replace the email action inside the loop with something that aggregates the content you want in the email.  Then once you exit the loop you can send the email with the aggregated content.  One common way to do that is with an array variable which you later convert to an HTML table to put into the email.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

10 REPLIES 10
Pstork1
Dual Super User III
Dual Super User III

Take a look at the dynamic content you are using on the Apply to Each loop.  You are passing it an object, not an array.  I think you just picked the wrong dynamic content.  Usually there is a Body and Value.  You want Value, not Body.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
NajukHusky
Regular Visitor

I have selected value

NajukHusky_0-1622471058997.png

Not clear for me where I can change from value to body her

Pstork1
Dual Super User III
Dual Super User III

Can you post a screenshot of a recent run showing the output?  Value should be the correct dynamic content, but the error suggests that what you are submitting is an object not an array.  If its not an array then you don't need the Apply to each loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
NajukHusky
Regular Visitor

NajukHusky_0-1622474235553.png

 

NajukHusky_1-1622474267525.png

 

NajukHusky_2-1622474294253.png

interesting cascading here, I am unfortunately not able to checkif that is what is expected or may be wrongly formatted in the file.

 

Pstork1
Dual Super User III
Dual Super User III

Sorry, I took another look at the screenshot and the error.  You have two loops.  The screenshot shows that the outer loop is using Value.  What is the inner loop (loop 2) using?  That's where the error is coming from.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
NajukHusky
Regular Visitor

Good hint, I was also looking on the first loop. The inner loops using the actual element. Idea was take always the actual element from the array. 

NajukHusky_0-1622530478502.png

 

Pstork1
Dual Super User III
Dual Super User III

Unless the elements are arrays you don't need Apply to Each loops at those points.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
NajukHusky
Regular Visitor

I've delete now all lopps and I have a loop free flow saved succesfully. Flow is in testing and is running since six minutes. Unfortunately I am getting now one email per found array element, in my cas approximately 346. My aim was to get only one mail, with 356 line entries. Any hint how to get the elements of the array in only one mail?

Pstork1
Dual Super User III
Dual Super User III

If you want only one email replace the email action inside the loop with something that aggregates the content you want in the email.  Then once you exit the loop you can send the email with the aggregated content.  One common way to do that is with an array variable which you later convert to an HTML table to put into the email.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Users online (2,363)