dipetersen
Apprentice

In Workflow (on-prem) How to tell if Item is New or Update? Is there a DELETED condition?

This seems like it should be an easy solution, but I can't find it.  I want to start a workflow when an item is either created or updated.  I know I can set the start conditions on a workflow, but that would require me to have two different workflows.  One for New and one for Edit.

 

What I would like is to set a condition (Edit or New) and then either execute an UPDATE in a database table or an INSERT in a database.  I can't see a way in Nintex Workflow to determine if the current list item is new or updated.  I realize that I can write a stored procedure that does this, but I am attempting to do it in Nintex first.  

 

Also - is there a way to run a workflow when an item is deleted?  I would like to perform a DELETE in an SQL table if an item is deleted.

0 Kudos
Reply
2 Replies
mindymac03
Scout

Re: In Workflow (on-prem) How to tell if Item is New or Update? Is there a DELETED condition?

Regarding your first question -  I have a list column called FormMode.

 

On my form, I have a calculated value that is connected to the FormMode column. The formula I use is:

If(Is New Mode || (cvStatus == "Copied"), "New", "Edit")

 

cvStatus is another calculated value on my form, but for your purposes, you could use :

If(Is New Mode, "New", "Edit")

 

In my list workflow, I use the FormMode value in a switch statement to determine what to do next (in my case: new item, copied item, edited item). I update this value to an empty string at the end of the workflow to "clear it out" so that next time someone opens this list item, the previous FormMode value isn't there messing things up.

 

I have not kicked off a stored procedure on a list item delete so I can't comment on that.

Reply
dipetersen
Apprentice

Re: In Workflow (on-prem) How to tell if Item is New or Update? Is there a DELETED condition?

I guess this is one solution but what you are telling me is that there is nothing built-in with Nintex that I can check to see if the list item is new or already exists. I suspect that there also isn't something that tells me that there is a DELETE flag.

I have a tool that I can use to synchronize a SharePoint list to a database table that I'll have to use but I was hoping to do something with Nintex. It seems like a fairly easy thing to include in the tool.
0 Kudos
Reply