0

I have a SharePoint list where I need to send a reminder email 1 day before the due date. I have a scheduled flow that runs from Monday to Friday so that the email only gets sent on work days. My problem now is, if the item due date falls on a Monday, it will not send the email reminder because 1 day before that is a Sunday.

Here is the expression that I'm using:

formatDateTime(addDays(items('Apply_to_each')?['Acknowledgement_x0020_Due_x0020_'],-1),'yyyy-MM-dd')

Will it be possible to incorporate in the above expression that if the due date is a Monday, send the reminder email the Friday before? Any guidance is highly appreciated. Thanks so much!

1 Answer 1

0

Add the expression within an IF function.

If today is Friday, subtract due date by 3 days , else subtract due date by 1 day

if(equals(dayOfWeek(utcNow()),5)
        , formatDateTime(addDays(items('Apply_to_each')?['Acknowledgement_x0020_Due_x0020_'],-3),'yyyy-MM-dd')
        , formatDateTime(addDays(items('Apply_to_each')?['Acknowledgement_x0020_Due_x0020_'],-1),'yyyy-MM-dd')
    )
1
  • This worked perfectly. Thanks so much thebernardlim ☺
    – Gen_C
    Apr 21, 2023 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.