setting a condition based on column name and modified date


Badge +3

Hi I  created a workflow and I have a loop that is set to start if changes are made to four columns.  Lets say my columns are f1, f2, f3, or f4.   Let say I have 10 columns but  I want to start the loop only if f1 or f2 or f3 or f4 have been modified.  Can I set a condition based on when a column was modified?    How do I do that? 


13 replies

Badge +16

Do you want the workflow to start based on these conditions or just the loop?

you can look at conditional start settings on the workflow itself (on workflow settings)

or you could use a run if action and put your loop inside that?

Badge +3

Hi Cassy, I just want the loop to run.  I have been working on this workflow for a while and I have already set workflow setttings to perform other task.   I think I have an ideal how to get my loop to work.  Thank you for your response.

Userlevel 5
Badge +14

unfortunately you will not be able to identify changes made to list fields within workflow in an easy way.

workflow does provide access to fields' previous values OOTB.

basically there are 3 possible approaches how to achieve that

- start workflow conditionally on a field change.

- parse and examine item's version history.

this requires versioning is enabled on the list.

to get item's version history you will need to make web service call to Versions.asmx. it return whole history track in a XML. so you will need to parse it out to get changes of your 4 fields and evaluate whether they are changes you need to process.

- maintain previous fields' values on your own in additional list fields.

that is toilsome, hard to maintain, and not reliable.

I'd recommend to go for conditionally started workflow.

likely you need not to change your existing workflow. create one another workflow (if you do not care which of four fields changed) or four another workflows (if you care) that will watch for filed change(s). from this/these workflow start your existing workflow.

Badge +3

Thank you Marian.  I am still a novice with Nintex but I thought about creating another workflow and starting it upon modify.  What I would like to do is create some logic that will run loop only if column f1 or f2, or f3 or f4 are modified.  Then go it my loop.  I have a wait state within my loop and I don't want the loop to start unless it meets the above mentioned conditions otherwise if it goes into my loop it will be in a wait state if none of those fields have changed.  It then will wait forever.  I still have not figured out the logic.

Userlevel 5
Badge +14

ok. so let's try to clarify things a bit more.

- what is the loop suppose to do? I hope it is not to process several (subsequent) changes to list fields...

- why do you need to wait within the loop? what do you wait for?

- is it important to know which of those 4 fields has changed?

create some logic that will run loop only if column f1 or f2, or f3 or f4 are modified

...

if it goes into my loop it will be in a wait state if none of those fields have changed

so do you check the same condition twice?

once before you enter loop, and within the loop as well?

could you maybe rather describe what's the process you want to implement instead of what you technically done?

maybe waitings a loops are not needed at all and someone might suggest better design.

Userlevel 7
Badge +11

Just throwing this out there.  I create a Nintex UDA that would tell me what has changed in an item.  This might help you figure out of one of your 10 fields have been modified, before it jumps into your loop.

http://www.vadimtabakman.com/nintex-workflow-what-changed-uda.aspx 

It's not a pretty solution... but might help you.

Vadim

Badge +3

Hi Vadim,

The work that I have done so far was based on information from your website.  Topic "Wait for Item Change".  I have learned a lot from your web seminars.  I was trying to log on to your website so that I could ask you questions but was unsuccessful.   I attempted to log on from 2 accounts 1 from my work and a personal account.  In both instances the website was suppose to send me a link so I could log on.  I never received the link and was unable thus not able to log on.   I will review you suggestion and may have additional question.  Thank you for responding to my post.

Viola

Badge +3

Hi Marian,

I have a workflow that is running exactly the way I want.  In the workflow settings, I have setting for modifying my form to perform other task.I have a snippet of code that works.    I have an action that will tell me what items changed. that fall into a loop.  That portion of the code works.   What I would like to do is to have that portion of the code to become active only if any of those 4 columns change.  Your suggestion that I create another work flow and have it run only when modified is what I plan to do next.  I want to put the code that has the working loop in the newly added workflow and I only want the "newly added workflow" to run only if any one of the four fields are selected.   F1, F2, F3 or F4.  If a change is made to Column F5 through F10.  I don't want that second workflow to run.  Thanks again.

Viola

Userlevel 7
Badge +11

Hi Viola,

I've been away and haven't had a chance to approve new users no my site.  You should be good now.

Vadim

Badge +3

Hi Vadim,

I have tried to log on your site from both of my e-mail accounts.  Could not log in.  I requested a password change on both accounts and the  site indicated that it sent an e-mail to complete task but I never received e-mail from either account.  I never really completed the original information to creae an account on your site because it was suppose to send me an e-mail for me to complete the sign up.  That e-mail never came. 

Viola

Badge +3

Hi Vadim,

I just reviewed the "what's changed" video.  I used the "wait for item change (snippet)" in my workflow.  I tested the program and it does exactly what I want.  The "wait for item change(snippet)" has an Action set and then it goes into a loop.  I only want that snippet of code to run only if the column are f1, f2, f 3 or f4 and the file is modified.  What someone had suggested I do is add a workflow set the workflow setting to execute on modified.  What I want to make sure is that it only execute the snippet of code  only if those four column changed.  Let's say that I have 10 columns.  If column f5 is modified I don't want the code to activate. 

Viola

Badge +1

Please provide access to you site, Vadim. I have an idea to the logic; however, the work flow that I am working on requires when an is set to a specific value then the work flow is initiated. I am thinking a simple for loop to iterate through each ID (Title) in said Lists, then when an item is changed to the specific value "Approved" that it will start the work flow. I just wanted to see about a run if function if and only if the Status is in deed, approved else there is no work flow initiated. Any thoughts?

Badge +1
"Done" will work for specific value too 🙂
To add to this: Assignments should be completed and can only be assigned done by a specific lead or supervisor. The version history would be nice to log to see the process of status of assignment from beginning to end of assignment.

Reply