How do I know if a Workflow coming from a Create or Modify Event?

  • 21 February 2017
  • 16 replies
  • 21 views

Badge +9

Basically, I want to write one workflow to cover both situations. I; however, want to change some wording based on whether the workflow is coming from a create or a modification.

I don't want to stick another column in the list called "new item" and update it.

I think there's a way to do this--but I can't find it.


16 replies

Userlevel 6
Badge +15

Hmm.. well, I suppose that would depend. If you were requiring a major version update each time, you could look at the version column -- if 1.0, then this branch; if larger than 1.0, a different branch.

Would that work for you?

Badge +9

It's a thought. 

Thanks,

Stephan

Badge +9

The particular library I'm using isn't being versioned. I probably could turn it on--but I'd like to find another way.

Userlevel 5
Badge +14

have a look whether this idea suits you

https://community.nintex.com/message/45782-re-how-to-check-whether-the-workflow-is-triggered-on-new-item-or-edit-item?co… 

Userlevel 6
Badge +15

This looks like a good alternative but it does recommend adding another column, which I think Stephan doesn't want to do.


That would have been my initial suggestion as well... but surely there must be something unique, by default, that a newly initiated form displays... hmm. I still can only think of ...

OH WAIT. What about Modified Date? If Modified Date is equal to Created Date? It would have to include time and be identical, but ... the only time that'd ever be true is on creation.

Would that work for you ‌ ?

Userlevel 5
Badge +14

Rhia Wieclawek, do you refer to the post marked as correct?

my suggestion there doesn't need any additional column in the list...

the link I provided should point directly to my post there, but sometimes browsers do not recognize/find an anchor within the page and end up at the top of page

I'm not aware of any OOTB reliable way to identify within workflow on what event it was started.

problem with modified/created dates are that

- they are just in minute-level precision. within a minute several changes can be be made.

- if items are created/updated from a program code, there are ways to do it so that version number and timestamps do not change

Userlevel 6
Badge +15

Ah yes, I see now - sorry, browser took me directly to the top post.

Userlevel 6
Badge +13

Good solution ‌

Userlevel 5
Badge +14

thanks happy.png

Badge +9

Where's the Created Date? All you have is modified date.

Badge +9

Looks harder than creating 2 workflows.

Userlevel 6
Badge +13

So if you create 2 extra workflows, one that runs on start and one that runs on modify, and both those workflows start your main workflow, you'll know what action started the workflow. You can even pass a variable from your first mini workflows to your main workflow, if that helps.

Badge +9

My experience with workflows starting other workflows is not good. I've seen humongous delays. I'd rather use a column.

Userlevel 5
Badge +14

hm, I don't think so.

if you create two full-functional workflow, likely you will duplicate plenty of functionality.

as well, if you already have the workflow (partly) developed, I see it as easiest approach without touching existing logic/functionality.

Userlevel 5
Badge +14

then I would maybe focus on resolving these delays. I use it regularly and haven't experienced such issues.

I would rather say I have minimum workflows that do not start other workflows.

Badge +9

This would work. However, in my case the list is preexisting and versioning wasn't enabled. So the older items are now version 1 and they are not really new.

I'm biting the bullet and adding a NewItem column. I'm setting the default to "Yes" and immediately updating to "No". I'm also updating the ones with a null value to "No" when they been worked on.

Reply