Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Send an email reminder to manage orders

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have a SP List "Orders" with the following columns:

- Order_Id

- Logistic_Email

- Delivery_Date

- Article

- Quantity

 

Exemple:

Order_idLogistic_EmailDelivery_dateArticleQuantity
1logistic1@mail.com01-08-2023Ball5
1logistic1@mail.com01-08-2023Frisbee10
2logistic2@mail.com01-08-2023Beach flag2
2logistic2@mail.com01-08-2023Umbrella3
2logistic2@mail.com01-08-2023Goodies10

 

7 days before the delivery date, I want to send per order_id an email with the list of articles of the order.

I'm very confusing in the order of steps in the loop:

- Append to array

- Set the order_id in a variable

- Test if the order_id changes

- Send the mail

- Reset the array

 

How can I know in the end of the loop, if it's the last article of the order and then, I can send the mail.

Also, I can have an order with only one article that match with 7 days before delivery so I have to test the length of the getitems action.

 

Can someone guide me?

  • raks Profile Picture
    on at
    Re: Send an email reminder to manage orders

    Thanks, it works perfectly as I want

  • Verified answer
    NickMerrick Profile Picture
    419 Super User 2024 Season 1 on at
    Re: Send an email reminder to manage orders

    Group by order ID using the method in the link below,  then look through the final array to send the grouped data in an email for each order

     

    https://johnliu.net/blog/2018/6/do-group-by-in-flow-with-two-simple-elegant-loops

  • raks Profile Picture
    on at
    Re: Send an email reminder to manage orders

    Because the flow must send one mail per order, there are 2 differents orders

    First order sent to logistic1

    Second order sent to logistic2

  • NickMerrick Profile Picture
    419 Super User 2024 Season 1 on at
    Re: Send an email reminder to manage orders

    why would your order id change? Looks like an easy flow. Have a recurring flow run every morning, filter your get items by Delivery_Date eq 'formatDateTime(addDays(utcNow(),7),'MM-dd-yyyy')'

    that will only return orders that need to be delivered in 7 days. Then for each loop through the records and send an email for each order.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492