1

I'm new to SharePoint Designer and I wondering if there is a way to trigger a List Workflow to execute on 1st of every month to loop through a SharePoint to create an email notice of files added in previous month. There seems to be two challenges.

1) Trigger workflow on the first of every month. OOTB triggers are based on created or modified date. I'm guessing windows task manager if it's not doable in the workflow.

2) Have the workflow loop through sharepoint and pull the file names/descriptions that were added the previous month based on create date. then add those file names, description, etc into an email. Can be HTML email.

Basically, an email notice on the first of every month on what files were added to the SharePoint the previous month.

1
  • Are you on 2013 or Online? ie. Can you use CSR (Client Side Rendering) – Danny '365CSI' Engelman Nov 5 '15 at 9:59
0

That is not possible, List workflows are triggered by 2 actions, when an item is created, or when an item is added.

There is also possible to create site workflows, site workflows allows you to define a schedule for your workflow, every day, every week, etc.

You can also create a timer job, which is executed at any point in time, you can schedule it as you which and implement the code logic in the timer job to create an email notice.

1
  • Ok, I understand the Workflow in SPD cannot be schedule and may need to be started using a scheduled windows PowerShell script. What about the second challenge where the work flow loops through the SharePoint and collect file information on files added in the previous month to be sent in one email? Is this possible? – sp_new_user Nov 4 '15 at 20:20
0

If you are in SPO, you can use Flow instead of WF, here you can trigger each month.

If you are in SPS, you can create Site Workflow and after this create Scheduled Job, which will start this script for starting Site Workflow, trigger once per month:

Add-PSSnapin Microsoft.SharePoint.PowerShell

$Url = "http://sharepoint.server.com/"
$Workflow = "WorkflowName"

$site = Get-SPSite $Url
$culture = [System.Globalization.CultureInfo]::InvariantCulture
$wfAssociation = $site.RootWeb.WorkflowAssociations.GetAssociationByName($Workflow, $culture)

if ( $wfAssociation )
{
    $assocData = $wfAssociation.AssociationData

    $wfRunOption = [Microsoft.SharePoint.Workflow.SPWorkflowRunOptions]::Asynchronous
    $site.WorkflowManager.StartWorkflow($site, $wfAssociation, $assocData, $wfRunOption)
}
else
{
    Write-Error "Workflow association not found on target web site."
}

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.