Hello,
I have a SP List "Orders" with the following columns:
- Order_Id
- Logistic_Email
- Delivery_Date
- Article
- Quantity
Exemple:
| Order_id | Logistic_Email | Delivery_date | Article | Quantity |
| 1 | logistic1@mail.com | 01-08-2023 | Ball | 5 |
| 1 | logistic1@mail.com | 01-08-2023 | Frisbee | 10 |
| 2 | logistic2@mail.com | 01-08-2023 | Beach flag | 2 |
| 2 | logistic2@mail.com | 01-08-2023 | Umbrella | 3 |
| 2 | logistic2@mail.com | 01-08-2023 | Goodies | 10 |
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?