Set field not working in state machine


Badge +1

I have a document approval workflow that uses a state machine to route approval through three groups, sequentially. After an approval group approves, I added "Set Field Value" steps to set three variables (approver name, comments, and date) that are columns within the respective document library.

However, the when the workflow completes, and I check those fields, the values are empty. The workflow steps look to have completed successfully, and I even set workflow variables and then logged them, to check that the data passed correctly, and the data WAS set to the workflow variables and presented correctly in the history log.

However, the data did not get set to the field in the current item, as it was supposed to. No error was thrown, it just didn't happen. I set field values at the start of the workflow, and they do update, but once I enter the state machine, the set field value actions stop working.  I tried replacing set field with update item, and that did not work either.

The data I am passing and setting is just string data, I tested by just setting string values to see if the set field would update the current item, but it does not.  Please help, I have looked online and cannot find any solutions to this issue.


7 replies

Userlevel 5
Badge +14

can you post details (screenshot) of your workflow?

do you have an end workflow action within SM branch? if so replace it with End State Machine action

Badge +1

Hi Marian,

       I do have an End State Machine action at the end of the SM branch.  At the beginning of the workflow, I set a field called Status to "Pending" so that the InfoPath document linked to it will follow a rule to lock certain fields.  The Set Field action works on this field earlier in the workflow, and the field is set to "Pending".

When the document is approved, I am trying to set the same field to "Approved", and then copy the item into another "Approved" library.  After a copy of the item is made, while the Status field value is "Approved", I then end the state machine and set the Status field once more in the original item to "Pilot" (this is the state in which users can edit an item).  This allows users to make edits to the original document, but only have "Approved" versions appear in the Approved library.

Setting the field to "Pending" initially, as well as setting the field to "Pilot" after the state machine both work, as expected, but for some reason the field never changes to "Approved", as I need it to. 

Note:  I even added a condition after I set the field to loop back to the Rule Approved state if the Status does not equal "Approved" and it rolls right through that, even though the field never changes!  All the other Set Field steps in the workflow seem to work fine, EXCEPT the Set 5D Approval Date in the same branch as the other Set Field that is not working.

I don't understand why this is happening.

Userlevel 5
Badge +14

try to add commit pending changes and/or pause for action after second set field action (one that sets approval date).

Badge +1

It had something to do with the item's permissions as it entered the state machine.  Essentially the item was breaking it's inherited permissions, so when I added a "Set Item Permissions" step, which tells the item to re-inherit its permissions from the parent, at the beginning of the Rule Approved channel, it worked.

Since the field was an InfoPath field, it wasn't getting set (fields I created as columns in the list were editable).

Odd.

Userlevel 5
Badge +14

haven't you changed permissions within task action?

Badge +1

Yes, but that alone did not work.

Userlevel 5
Badge +14

ok.

so, is this resolved?

Reply