2

in my sharepoint designer workflow when an item is created an email will be fired. I have a requirement to change my sharepoint designer workflow emails based on time.

ie if the time is between 8:00 am to 5:00 pm then email should go to John, from 5 to next morning till 8:00am it should go to Andrew.

How do i do this?

4

Here is one way:

Workflow

enter image description here

Workflow variables

enter image description here

Depending on your locale there might be differences in how the DateTime string is formatted but the principle stays the same.

You extract the necessary parts from the DateTime string and then you cast them to a number, that you can then easily use in an if-else-clause.

The DateTime string for my locale looks like that: 6/6/2018 6:51:48 PM

I tested it at 6:51 PM and it logged correctly greater than 6 to the workflow history list.

All you have to do is to adjust the if-else-clause to your exact requirements.

| improve this answer | |
3

You can use the creation date of the Item ,

  • by creating a date workflow variable ( CreationDate ) holding the creation date ,
  • and other two date variables by using Set Time as action , first variable ( date2 ) will hold the same creation date 8:00 AM
  • the other variable ( date3 ) will hold the same create date 5:00 PM.

Next thing is to check if creation date accrued during the working hours (8:00 AM to 5:00 PM) or not using if conditions.

please check the below workflow screen, hope this will be helpful.

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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