Forum Discussion
Need help with an expiration flow.
Hi All,
I need to built a expiration reminder flow when an item in a list is modified or created. The flow takes expiration date from the one of the column of the list and sending emails three days prior to the expiration date , one day prior to expiration date and also when expired.
I have tried a couple of days but ended up with no luck. Please advice.
5 Replies
- Damien_RosarioSilver Contributor
Hi Santhosh_V
Can you show your flow so we can diagnose?
I have built a flow that does exactly that for 14, 7 and next day reminders based on a SharePoint column value, so I can help you to find the issue but need to see what you have come up with.
Cheers
Damien
- Santhosh_VCopper Contributor
Damien_Rosario Thanks for reply.
Please review my flow ,
All the do until having the same values only condition will differ.
There 3 do until in parallel for each remainder.
Dountil1 : today'date prior to 1 day
Dountil2 : today'date prior to 3 day
Dountil1 : today'date equals to exp date
variable Today's date :formatdatetime(addDays(utcNow(),0), 'yyyy-MM-dd')
Variable 2(One Day prior): formatdatetime(addDays(outputs('Get_item')?['body/EXPDate0'],-1),'yyyy-MM-dd')
Variable 3(three day prior): formatdatetime(addDays(outputs('Get_item')?['body/EXPDate0'],-3),'yyyy-MM-dd')
If the conditions satisfies send an reminder email. Also please suggest its possible to run a flow for more than a month (Aware timeout is max P1M)Just for an doubt. Looking for advise.
- Damien_RosarioSilver Contributor
Hi Santhosh_V
You do it a different way to the way I do it.
Here's a different way to approach your reminder workflow.
If, when the new SharePoint item is created or modified, a date is captured in a SharePoint field, you can have that as it's own flow and then a separate flow as the reminder flow.
E.g. Flow 1 - Capturing the expiration date
1. (Trigger) When an item has been created or modified
2. Convert time zone (this helps to ensure that the base time, source time zone, destination time zone and format of the date/time matches your settings so it captures the right date/time + whatever days you want the reminder to be).
3. Update item (ensure that the Expiration date column has the date value input into it from the Convert time zone + whatever days you want the reminder to be)
E.g. Flow 2 - Reminder workflow
1. (Trigger) Automatic loop (you can set the interval and frequency of the loop to run)
2. Convert time zone (this helps to ensure that the base time, source time zone, destination time zone and format of the date/time matches your settings and triggers accurately).
3. Add your actions for the Condition and email as needed.
As far as I know, Automatic loop doesn't expire as I've had mine running since March 2019.
Hope something in there helps.
Cheers
Damien