I'm posting my solution for this common issue here in the hopes to help other users who have similar requirements to assign Flexi-tasks to users on Business Days only. I had seen on nintex community that there was a UDA created for this but it didn't work properly for me (due dates were just blank). I am using SharePoint 2013.
Here is my manual workaround that has been working very well for my workflow:
- Query List Action - this is used to query a list we have on our site where the number of days to complete a task is stored. This is used to find the appropriate number of days given certain conditions but if your days are standard for all tasks this is not necessary. Output is a number variable, varDaystoAdd
- Calculate Date Action - adds varDaystoAdd to current date and stores in date variable, varDueDate
- Set Variable Action - finds the day of the week varDueDate is:
- use function: fn-FormatDate(varDueDate, "dddd") store in varDay
- "dddd" will output the day of the week written out ex) "Friday", "Saturday" or "Sunday"
- Log day - i used this just to record varDay for troubleshooting purposes
- Conditional Statement - is varDay = value of Saturday?
- If Yes, add 2 days to due date
- Date is varDueDate, put value of 2 in Days field and store again in varDueDate
- If No, nothing happens
- If Yes, add 2 days to due date
- Conditional Statement - is varDay = value of Sunday?
- If Yes, add 1 day to due date
- Date is varDueDate, put value of 1 in Days field and store again in varDueDate
- If Yes, add 1 day to due date
I hope this is helpful, please put any questions or comments below