0

I have a SharePoint 2013 workflow created in VisualStudio (not Designer).

Originally this workflow only ran on ItemAdded, but now I need it to also run on ItemUpdated.

Is there a way to tell from within the workflow which event triggered that instance?

I see the LookupWorkflowContextProperties activity, but that only allows you to check

  • Associator
  • Initiator
  • Association Name
  • Instance ID
  • Current Site URL
  • Current Item URL
  • List Name
  • List Id

with nothing about the triggering event.

0

Try getting the value of WorkflowSubscritpionEventType enum in your code.

According to below documentation, It will return 1 for ItemAdded and 2 for ItemUpdated trigger.

public enum WorkflowSubscritpionEventType
{
    None = 0,
    ItemAdded = 1,
    ItemUpdated = 2,
    ItemDeleted = 4
}

Source: GitHub - WorkflowProvisionService.cs.

|improve this answer|||||
  • Do you know which workflow activity exposes that value? In building the workflow in VS, I'm not writing code per se, but using the workflow designer to build the workflow using "activities" that are in the Microsoft.SharePoint.DesignTime.Activities or Microsoft.Activites namespaces. I need to be able to determine the trigger even using those provided tools. – Dylan Cristy Jan 7 at 15:03

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.