Conditional Logic


Badge +11

I have a SharePoint (2013) list. I want to create a Nintex workflow (2013) that if the Status column changes to 'Closed' from any other status, then add a 'Closed Date'. If the 'Status' column is already set to 'Closed', DO NOT change the 'Closed Date'. How can I set the logic up to do this?


11 replies

Badge +11

In your Workflow-Settings you configure your workflow to start on item modified - conditional. In the conditions you can access your status field and check if it's "Closed". You can also check for the previous value of that column to see if it was not "Closed".

Regards

Philipp

Badge +11

Currently, I am doing that. But I will need to add code in the workflow itself. What do I need to add there?

Userlevel 5
Badge +14

wouldn't it be enough to check the condition like status == 'CLOSED' && IsNullOrEmpty(Closed_Date)?

Badge +11

That sounds perfectly fine as well.

So what do you need code for?

Badge +11

Hmmmm ‌ that may work. I need code to set the 'Closed Date'. If it was previously closed I don't want to set the date - only if it was just changed. That was the problem the user was having. Regardless of when the item was closed it would set the 'Closed Date'.

Badge +11

I don't see IsNullOrEmpty() in the Inline Functions list. Can you please give me a screenshot of what ya'll have in mind?

Badge +11

 and  - I MAY have gotten this to work. I removed the start-up condition they had for Add. I left the start-up condition for Modify. Then I simply added the 'Set field value' and set 'Closed Date' = current date. No need to do an if statement or anything since it will get in the workflow on the right condition. I'm waiting on the user who wanted me to fix it to see if that will work for them. I think I was making this harder than it needed to be. I'll keep you updated.

Userlevel 5
Badge +14

in workflow you have to use set condition action

Badge +4

I suppose this issue has been resolved?

Another thing i wanted to add. Working with dates and checking if it's empty is a bit tricky. You can also check if a date is smaller than a certain date (we use 01/01/2000)

An empty date may equal the dates 01/01/0001 or 01/01/1900 (there is a logic to this, but i'm not fully certain i've found it yet) 

Badge +11

I'm waiting on the user to come back to let me know it worked. He had to work on something and is supposed to get back to this.

Userlevel 5
Badge +14

Hi ‌, still waiting on a user? happy.png

Reply