I would like my workflow in SP Designer 2013 to only run if it is within 7 days of my column [Hire Date], otherwise, pause until that date. I see how to create the column if it is exactly 7 days from the hire date, but if the item is created 3 days before, I'd like it to run as well. I need a statement like "If t[Current Date] is 7 days or fewer from [Hire Date] then start workflow, Else, pause until 7 days before. My current column is =DATE(YEAR([Hire Date]),MONTH([Hire Date]),DAY([Hire Date])-7) How can I make it "or 6,5,4,3,2,1" days?
3 Answers
A possible way of doing this would be:
Within your workflow create a local variable called "PauseUntilDate", and get its value as
PauseUntilDate = Hire Date - 7 daysNext write a pause until statement to make the workflow wait until "PauseUntilDate"
If the "PauseUntilDate" is yet to come, the workflow will begin execution on the designated date.
If the "PauseUntilDate" has already passed, the workflow will realize this within about 5 minutes and run the next statement.
And of course, delete the calculated column, you don't need it anymore.
- 957
- 1
- 11
- 24
You can try making the workflow pause based on a boolean field calculated with following formula;
=IF((DATEDIF([Hire Date], Today(),"d") <= 7),"")
Read more about principals used here
and
Please Note: This solution will only work if workflow is triggered on item create or item update.
- 121
- 5
-
2[Today] will not do what you expect it to do: http://sharepoint.stackexchange.com/questions/151144/how-to-use-today-and-me-in-calculated-column/151336#151336 – Danny '365CSI' Engelman Apr 15 '16 at 19:28
-
I'm receiving an error on the [Today] part. Should I be replacing that with a variable? – markasey Apr 15 '16 at 22:16
-
Thanks Danny-- I just saw your comment after I posted mine. I'll check out that link. – markasey Apr 15 '16 at 22:17
-
@DannyEngelman excellent link. Thank you. I didn't try the formula before posting hte answer. Edited to remove the [Today] dependency. – Salman Siddiqui Apr 16 '16 at 21:10
-
1In your answer you now replaced [Today] with Today(), which has the same issue. It will only re-calculate (to todays date) when you edit the Item or Formula. Unlike Excel it is not Todays date in Views: http://sharepoint.stackexchange.com/questions/151144/how-to-use-today-and-me-in-calculated-column/151336#151336 – Danny '365CSI' Engelman Apr 17 '16 at 09:55
-
He wants the workflow to trigger... he just wants it to pause if the hire date is more than 7 days out. – Erin L Apr 18 '16 at 18:43
-
Assumption is that OP will trigger the workflow on item create or update and pause the execution based on proximity of hire date. – Salman Siddiqui Apr 18 '16 at 21:21
Variables will solve your problem:
- First you should make a Variable call (-7Day) which is Hire Date-7. (which is the exact start date)
- make your work flow on this condition:
IF [Current Time] equal or greater than [-7DAY]
- then the actions which you need to be done in next step
- 469
- 7
- 20
Add -7 days to [Hire Date]output to variablePauseUntilDate, thenPause untilaction withPauseUntilDatevariable. – Erin L Apr 18 '16 at 18:50