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
Answered

for each

(0) ShareShare
ReportReport
Posted on by 12

Hi i have a problem when i arrive at the for each flow anyone know what i can do 

flow 7.png
flow 6.png
Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Denilson ï¼Œ

    Please try replace outputs('Filtrer_un_tableau')[body/value'] with body('Filtrer_un_tableau') in Create HTML table From:

    vyetonggumsft_0-1717642190678.png

     

    body('Filtrer_un_tableau'):

     

    Best Regards,

    Sunshine Gu

  • Denilson Profile Picture
    12 on at

    Hi okey the flow work but when i get the mails i get to many mails not just one 

  • CodrutFt Profile Picture
    46 on at

    Hello,

     

    you get these e-mail because you have a for each and probably you body is an array. Try to get only the first item using .First() of the body. You need to pay attention to what variables are you using inside Send e-mail. If you use the variables from the body to have the contact list, just do body("Filter_un_Tableau").First()?['Contact'](Something like this, you need to test the expression), where 'Contact' is just a guess of mine about what you are using inside "send e-mail" action.

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Denilson ,

    Please check this test.

    Please switch to classic designer.

    vyetonggumsft_1-1718350754808.png

    My SharePoint List:

    vyetonggumsft_9-1718351508891.png

    My Flow Preview:

    vyetonggumsft_0-1718350689807.png

    Flow Configuration Parameters:

    vyetonggumsft_2-1718350866096.png

    item()?['Emailaddress']
    union(body('Select'),body('Select'))

    vyetonggumsft_4-1718351136496.png

    item()?['DueDate']
    item()?['Status/Value']
    item()?['ID']
    length(body('Filter_array'))

    vyetonggumsft_5-1718351241792.png

    join(body('Select_2'),';')
    join(body('Select_3'),';')
    join(body('Select_4'),';')

    vyetonggumsft_7-1718351408462.png

    Inbox Email:

    vyetonggumsft_8-1718351459897.png

    Best Regards,

    Sunshine Gu

  • Denilson Profile Picture
    12 on at

    hi 

    the flow is working now but everyday i get a new email instade of just geting one will it is the due date but i get emails everyday and i dont want it to come everyday but just when the equipement is getting to it due date

    Capture d'écran 2024-06-17 081817.png
  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Denilson ,

    Please add the filter condition of whether the Due Date is equal to today's in Get items, and then check whether the length is greater than 0, and send the email only if it is greater than 0.

    vyetonggumsft_1-1718606406854.png

    DueDate eq '@{utcNow('yyyy-MM-dd')}'
    length(outputs('Get_items')?['body/value'])

    The Result:

    vyetonggumsft_2-1718606418012.png

    Best Regards,

    Sunshine Gu

     

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

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 411

#2
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 291

Last 30 days Overall leaderboard