How to check whether the workflow is triggered on New Item or Edit Item?

  • 19 August 2016
  • 2 replies
  • 59 views

Userlevel 3
Badge +12

Hi,

Initially I created a workflow that runs only when new item is created. Now there is a change in functionality, and I want to run the same workflow when user edits the item. How would I check in the workflow that "the workflow is triggered due to new item or edit item"? During edit, user can modify an field/column of item. Any thoughts?


2 replies

Userlevel 3
Badge +12

Hi Colin

I was also thinking same approach, I just wanted to check if there is any alternative to it. I will go ahead with this approach. Thank you.

Userlevel 5
Badge +14

there is one another alternative.

you can set your existing/main workflow not to start automatically neither on item create nor item update. configure that workflow to accept one input parameter to recognize triggering event.

then create two additional small workflows that will start that main workflow. configure one workflow to start on item create and the other on item update. both these workflows would hand over respective triggering event to the main workflow.

I would see following (small) advantages to the concept proposed by Colin.

- if you need to start the workflow manually simulating one of the events you need not to change the item (status column). such an update generates record in item history and updates date columns, which in some scenarios might be undesired. Likewise, it would trigger on update workflow even if you were preparing status column to run on-create workflow.

- if you need to apply some complex logic on when on-update workflow should run, you can hide it into that small workflow

- it allows you  to start the main workflow multiple times on an item if you needed. just turn the main workflow from list one to site one.

Reply