Hi there,
I am trying to calculate how send a reminder.
My SP List is like below:
Start Date | Engage in # Months
1/1/23 | 12
20/2/22 | 48
12/20/23 | 12
Basically the logic is to send a reminder base in these 2 columns: Start Date + Engane in # Months
Thanks
no words to describe how much you helped me! I learned a lot from your answer. Many many thanks, brother!
Are you able to add a column to your list that is "Start Date" + "# Months"?
Calculated Column:
=IF(ISBLANK([StartDate]),"",DATE(YEAR([StartDate]),MONTH([StartDate])+[EngageInXMonths],DAY([StartDate])))
My list ends up looking like this (with my calculated column, "EngageOn")
You'll need to create a Recurring flow. Set to Daily.
Then, you need to calculate the current day. Initialize a variable, (txtCurrentDate) click in the field, use "Expression", and do "utcNow('yyyy-MM-dd').
Now with your handy-dandy calculated column, life is easy:
"Get Items" without any filter.
Then, "Filter Array". Point it at your output from Get Items.
Then, "EngageOn" contains txtCurrentDate.
If you get anything from this, it means you have to send a reminder / notification for each hit. If you don't, then no reminders are due. Run it now, just to see how it works -- and while you're there, copy the Output from the Filter Array.
So now I'll just do this:
Parse JSON, so we can use the actual fields. You can paste what you've just copied from the outputs after clicking the "Generate from Sample" button. Point the "Content" field at your "Body" from the Filter Array.
A condition length(body('Filter_array')) NOT EQUALS 0. If that's true, then it means we got a hit. If it IS 0, then nothing requires a reminder.
Then, life as normal. If yes, send the email. Use the Send An Email action, and you can access all of your fields from the "Parse JSON" output. If no, terminate.
So, as an example of a successful run, our filter brought back 2 hits (which you can see form my first screenshot, of the list, is correct) and so we are "sending two emails" (I'm using a compose as an example.)