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 Apps / for each error in flows
Power Apps
Answered

for each error in flows

(0) ShareShare
ReportReport
Posted on by 608

flow1.png

Scenario - this is needed for internal salesforce

On nightly basis pull all salesforce opportunities that are closed and send emails(email taken from their outlook) to sales rep in a single email(list of 10 opportunities closed to a single sales rep)

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi AmitLoh,
                         
    It looks like that “Apply_to_each2” has some invalid arguments. How did you configure the “Apply_to_each2”? Could you show me a screenshot of your flow?

     

    Best regards,
    Mabel Mao

  • hngdev Profile Picture
    304 on at

    Flow doesn't allow nested loops of conditional loop. I think you are using the nested loop so the error shows up.

  • AmitLoh-Powerap Profile Picture
    608 on at

    ok so how do I satisfy below salesforce use case?

    I think if this is a limitation I need to write custom API connector code for this(which I wanted to avoid) .

    Scenario - this is needed for internal salesforce reminder requirement

    On nightly basis pull all salesforce opportunities that are closed and send emails(email taken from their outlook) to sales rep in a single email(list of 10 opportunities closed to a single sales rep)

  • hngdev Profile Picture
    304 on at

    what you can do is use Filter Array to filter all records that meet your conditions and then use Compose to construct your emails. It's really hard to give an exact answer because I don't quite understand the use case.

    If your flow isn't triggered from PowerApps, I recommend that you should use MS Logic App, it's more customizable even when you're still not able to use nested/conditional loops and I think Flow is actually built from Logic App.

  • AmitLoh-Powerap Profile Picture
    608 on at

    I am not sure how to use Filter Array. I tried it but it should do for each after that and send email and there it gives same error. I may need to write coded integration as I need advance conditions working.

  • hngdev Profile Picture
    304 on at

    Filter Array is useful if you want to create conditonal loop, something like this:

     

    flow.PNG

  • AmitLoh-Powerap Profile Picture
    608 on at

    thanks but now inside this apply each try to send email or do some action, it does not work.

  • AmitLoh-Powerap Profile Picture
    608 on at

    thanks but now inside this apply each try to send email or do some action, it does not work.

    In your POC you get items from sp list with title containing "test"(so 3 out of 10 items as example) and send email to a person with all the 3 items in single email.

  • hngdev Profile Picture
    304 on at

    I think it should work because we don't have any conditions in the loop anymore.

     

    flow.PNG

     

    Or do you mean anything else?

  • AmitLoh-Powerap Profile Picture
    608 on at

    It does not work, do not put hardcoded values as in your screenshot, try to put actual values from list title(thats the business requirement), hardcoded test value work for me too.

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 Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard