views:

42

answers:

2

I have a SPD workflow that is set to run when an item changes but it keeps getting triggered on new items, which is pretty annoying. I'm looking into why this is happening but I'm also looking for a way to terminate the workflow if the item is new as a temporary workaround.

I tried to compare the Created field to the Modified field i.e. if Created and Modified are the same then don't run. This didn't work, either as a date or string comparison.

Any suggestions would be much appreciated.

A: 

I have faced this same issue and I solved with the workaround like this

  1. Take created date and add 1 minute with it and assign it to a variable
  2. Check this variable less than current time.

    It done with the following assumption

a. No one try t edit the item within one minute, it created

b. Workflow will execute within one minete

In my case it was success

Hojo
A: 

Store a flag in a hidden field the first time the workflow is run. Check if the flag is present, if not then it is the first time (created), otherwise it is updated.

Muhimbi