none
Send an email to a different recipient after normal business hours.

    Question

  • I am using SharePoint 2013, InfoPath 2013 and SP Designer 2013 all out of box.

    I have an established process that uses an InfoPath form to accept requests that are submitted to a SharePoint 2013 library. There is a custom workflow attached to the library that sends a notification for approval of the request to a predefined number of managers. What I would like to do, is to find a way to send the approval notifications to a different set of managers after normal business hours. So say from 5:01 PM to 7:00 AM. Then have it return to the normal set of approvers from 7:01 AM to 5:00 PM again on a daily basis.

    I do not have the experience to write code. I can only use code within the form as long as the form can retain domain level security. We are a highly locked down institution, so I cannot use add-ins or administrative templates.

    I thought the easiest way would be to get the form to somehow determine what time of day it was and set a field to "Day" or "Night" when submitted. That would be more than sufficient for the workflow as I could route approvals based on that field. Requests are not submitted constantly and some days there are none. But in the case one is submitted after hours, I would like the notifications to go to the night crew.

    Any advice would be greatly appreciated.

    Friday, February 10, 2017 11:19 PM

Answers

  • Hi Maxnimrod (love that profile name!): what you could do is create a calculated column (text) and enter this formula:

    =TEXT(Created,"hh:mm AM/PM")

    That will give you a text box for the current time. Then create another calculated column with this formula:

    =IF([Calculated Time of Day]>"07:00 AM","1",IF([Calculated Time of Day]<"05:00 PM","1",IF([Calculated Time of Day]>"05:00 PM","2",IF([Calculated Time of Day]<"07:00 AM","2" ))))
    That will give you a 1 if it's daytime or 2 if nighttime. You could use that for your workflow, so that if time = 1, send email to these people, else send it to these people.


    cameron rautmann

    • Marked as answer by Maxnimrod Tuesday, February 14, 2017 11:33 PM
    Monday, February 13, 2017 7:54 PM

All replies

  • Hi Maxnimrod (love that profile name!): what you could do is create a calculated column (text) and enter this formula:

    =TEXT(Created,"hh:mm AM/PM")

    That will give you a text box for the current time. Then create another calculated column with this formula:

    =IF([Calculated Time of Day]>"07:00 AM","1",IF([Calculated Time of Day]<"05:00 PM","1",IF([Calculated Time of Day]>"05:00 PM","2",IF([Calculated Time of Day]<"07:00 AM","2" ))))
    That will give you a 1 if it's daytime or 2 if nighttime. You could use that for your workflow, so that if time = 1, send email to these people, else send it to these people.


    cameron rautmann

    • Marked as answer by Maxnimrod Tuesday, February 14, 2017 11:33 PM
    Monday, February 13, 2017 7:54 PM
  • Haha, Thanks. Not many people understand what it means.

    This is a great solution. Thank you very much ))

    I can see how this can be useful in other ways too.

    I appreciate what you and everyone else does here to assist the community. You make us look good with our management))

    Thanks again!!

    Tuesday, February 14, 2017 11:36 PM
  • Glad to help. Just send my consultant fee + 20% tip for making you look good and providing job security. Being Maxnimrod, I guess you'd fall for that ;)

    cameron rautmann

    Wednesday, February 15, 2017 1:10 PM