Conditional Start on Modified - Not working


Badge +8

Hi everyone,

I have a workflow running on a choice column, and have set it to start on modified based on whether the column changes from its previous value. When I change the selection in the column, it does not fire.

To try to determine why that was, I changed to on modified condition "yes" then changed the the selection in the column and the workflow fired.

Any idea on why it would work for "yes" on a modified condition but not a "compare previous" condition?

If it matters; the workflow begins with a switch action.


31 replies

Badge +7

Hello Howard,

I had a similar question to yours a while back.

Have a look at the following question and answers - How to fire a workflow only when an item is modified

This might help you

Badge +8

Thank you, I have followed that post and will use it for future reference but I don't find it applicable to the issue I'm currently having.

Userlevel 6
Badge +12

Hello guerlain.howard@amerigroup.com​ -

In your workflow settings, look at 'Start when items are modified', and set that to 'Conditional'.

In your conditions, you can evaluate previous values like so:

182497_pastedImage_0.png

This will cause the workflow to trigger when the item is modified AND (more specifically) the status has changed.

Hope this helps!

Badge +8

This is exactly how I had it set up. It does not work, the workflow will not start with that condition set.

It will however work when I only select "Yes" for it to run when modified.

Userlevel 6
Badge +12

In your choice field that you are referencing, what are your options?

What about the display name and values?

Badge +8

The choice default is "None."

The choice field is populated by a site workflow, and changes to "Pre-Assign 1"

The choices are:

None

Pre-Assign 1

Pre-Assign 2

182499_pastedImage_0.png

Userlevel 6
Badge +12

Ah ok, missed the site workflow piece of it.

I tested it where the list choice column is updated by a site workflow and it did run the list workflow upon update.

There was a delay, only because the way timer jobs run, but it did fire eventually.

Can you confirm that list item is being updated properly and as expected?

I did see "starting" in the workflow column after the site wf updated the item:

182528_pastedImage_0.png

Badge +8

Yes, the site workflow is updating the list properly. I have even tried manually changing choices as well.

The workflow that has the condition start does not even show as starting or anything for me

Userlevel 6
Badge +12

Hmmm...Not sure without diving into what you have setup already, and to confirm, you are attempting to use a site workflow to update a list item, which then triggers a list workflow, correct?

I would create a new workflow on the same list and make sure that it is behaving as intended.

Set the "start on modified" conditionally and test it to make sure its working.

I have seen in the past strange behavior and had to start over from scratch and it cleared up issues.

Userlevel 7
Badge +11

By any chance, is the SIte workflow running as a system account ?

Badge +8

According to the Modified by and User ID of the workflow history, yes it is.

Userlevel 6
Badge +12

Doh.....Try running it as yourself, not the system account.silly.png

Badge +8

I've also tried changing the column manually, without the site workflow running and it doesn't work.

But, how do I run it as myself?

Userlevel 7
Badge +11

Yeah this will be the issue then.. SHarepoint doesn't allow System Accounts to start workflows plain.png You could run this command on your SP box, and then see if it works..

$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled

If the Value of the property is "False" you have to enable it by typing the following commands:

$spWebService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

$spWebService.DeclarativeWorkflowAutoStartOnEmailEnabled = $true

$spWebService.Update()

Badge +8

I'm assuming I have to have admin right to do this?

If so, I do not have them.  If not, I haven't a clue on how to do it.

Badge +8

I also don't understand why it does work when the modified setting is simply "Yes".

I guess I could let it run on modified and set some kind of filter, but that would have it running with each modification, which I don't want.

Badge +8

I tried creating a new workflow and it still did not work. Ironically I have several other workflows that start conditionally that have no issues.

Is there a limit to how many columns workflows can start conditionally on?

I really can't think of any reasons why the conditional start won't work in this instance when it works for others.

Badge +7

I have managed to replicate this issue, it's a bit weird. In my case the workflow does start and goes into an In Progress state but then reverts back to Starting and gets stuck. Logs, history and farm are ok as is everything else.

I'll have a dig around and see what's going on and let you know if I find anything.

Jan

Badge +8

Thank you! happy.png

Badge

I'm having this same issue - and also have other conditional-run-on-change workflows that are working...

also - it runs as expected when started manually so the issue appears to be with the conditionals

182557_pastedImage_0.png

Badge +8

So I'm not crazy!? lol

Are your conditions based on choice columns?

Badge

Yes.  It did work once or twice but I’ve made MANY changes since then so going back would be near impossible.  I did create another identical workflow and that one has the same issue?!

Pretty coincidental that we run into the same issue within a day of each other…weird

(and I’m glad to know that I’m not crazy either!)

Badge

That’s a little problematic as the list has a sub-list and has proven to be difficult (if not impossible) to export. However, I do have another conditional start-on-change workflow on this same list that is working…or perhaps that’s the problem? As I said, it did work as designed initially.

Badge +8

Is there a way to find the "bad columns" I have a variety of workflows running on this list and the thought of recreating it makes me cringe. happy.png

Badge +5

Can I ask if when the site workflow does the update you are updating more than one of the columns that would conditionally start a workflow? In a recent implementation I found that when this was the case, only ONE of the more than one workflows you would expect to start actually did...we had an open support ticket re this behaviour.

So to be clear...if have workflow 1 which conditionally starts on update of the STATUS column. And workflow 2 which conditionally starts on update of the e.g. DOCUMENT OWNER. If both of these columns are updated by the site workflow, only workflow 1 starts. That is the behaviour we observed and could reliably reproduce.

Reply