Hi all,
I am attempting to build a flow to send reminder emails from a specific email address to a specific email address 30 before expiry date.
I have numbered pouches that contain multiple products - each pouch contains the same 8 products with a variety of different expiry dates.
So the expiry date for product A in pouch 1 might be different to the expiry date for product A in pouch 5.
I have a SharePoint list that is set up as follows:
My first column is the pouch number I.e. 1, 2, 3, 4 etc and each subsequent column is the product name I.e. Cheese, Bread, Milk. The expiry dates are then filled into the appropriate box.
I wish to send an email to a specific email address from a specific email address 30 days before a product is due to expire. I wish the email to say something like:
“Cheese is due to expire in 30 days in the following pouches:
1
5
9
Bread is due to expire in 30 days in the following pouches:
1
4
6
Milk is due….. etc”
Here is an image of an example list setup the same as my list
thanks for your assistance
Solved! Go to Solution.
I think I see why dates are not working for you. I just noticed you said you formatted the expression for the Expiration variable to addDays(utcNow(),30,'dd/MM/yyyy'). While your dates can appear in different formats on screen via your site and profile settings, the date stored in SharePoint is actually stored in ISO8601 format. You need to use that format in query filters and other logic in Power Automate. For your Expiration variable, it needs to be formatted as addDays(utcNow(),30,'yyyy-MM-dd')
If I accurately understand what you want to do, this is not too complicated. You will use the following actions three times to get each of your product types, and then combine the results into your e-mail:
At a high level, your workflow will look like this:
This is the final result:
Hi David,
Thanks for getting back to me so soon.
I have tried this and although it sends an email, it does not show the pouch numbers. (See below)
I have my list set up in what I imagine is an identical way with the list title as "Pouch1", columns names "Pouch, Cheese, Milk, Break"
I have began by just trying to get a single product working and then I can copy the results for the remaining. At the high level this is my flow:
and looking within each stage is as follows:
Initialize variable Expiration does output a date 30 days in future (03/11/2022)
The expressions are as follows for each stage:
Initialize variable Expiration:
I believe it is because the product column in the list is formatted as a date and time. When I set the column formatting to single line of text it returns the pouch numbers correctly.
It could be a couple of things; however, you definitely want your fields with the dates to be date/time columns, but you don't need to store the time.
The example list above I have dates for the "Cheese" column set as 02/11/2022, 03/11/2022 and 04/11/2022 (UK date format) dd/MM/yyyy
In the filter query I had been using the name as describes from the URL.
When I set the cheese column as Date and Time it returns no pouch number. Change the column to single line of text it returns the pouch number correctly. It just appears to be the column formatting that makes it work / not work.
Glad you got it working!
just to clarify - it doesnt work with the column set to date and time, but does for single line of text.
I can work with it as single line of text but would be cleaner if set to date and time
I think I see why dates are not working for you. I just noticed you said you formatted the expression for the Expiration variable to addDays(utcNow(),30,'dd/MM/yyyy'). While your dates can appear in different formats on screen via your site and profile settings, the date stored in SharePoint is actually stored in ISO8601 format. You need to use that format in query filters and other logic in Power Automate. For your Expiration variable, it needs to be formatted as addDays(utcNow(),30,'yyyy-MM-dd')
User | Count |
---|---|
92 | |
45 | |
21 | |
18 | |
16 |
User | Count |
---|---|
136 | |
49 | |
42 | |
36 | |
28 |