2

I have created an approval request from using InfoPath that is connected to a Sharepoint 2013 list. My goal is to create a workflow that sends an email containing certain elements of the information collected on the form to managers but the challenge is that management only wants to receive these type of request on either a Tuesday or a Thursday of each week.

Would greatly appreciate your help on how I could build that functionality in a workflow.

Thanks!

2

There are two methods, you can check if it’s feasible for your requirement:

1.You can create a simple workflow associated with the list to send email to relevant users. Then write the PowerShell to run the workflow on all items of a list as below:

# URL of the Site
$web = Get-SPWeb -Identity "http://sharepointsite"
$manager = $web.Site.WorkFlowManager
# Name of the list
$list = $web.Lists["Shared Documents"]
# Name of the Workflow
$assoc = $list.WorkflowAssociations.GetAssociationByName("WFName","en-US")
$data = $assoc.AssociationData
$items = $list.Items
foreach($item in $items)
{
$wf = $manager.StartWorkFlow($item,$assoc,$data,$true)
}  
$manager.Dispose()
$web.Dispose()

Reference: SharePoint Start Workflow on All Items of a List via PowerShell

Then use Windows Task Scheduler to run the workflow every Tuesday or Thursday.

Reference: How to: Run PowerShell Scripts from Task Scheduler

2.Add a stage at the end to put in a “Pause for Duration” action. And we can set this for 7 day (or 168 hours). For the Transition to stage, make it to back up to the first stage.

Then run the workflow first time in Tuesday or Thursday.

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.