Skip to main content

Hi
I have a document library where I added one numerical field Days with default value = 3. No versioning, no approval, no managing content types.
I created a workflow that  start on item created and item modified.
The workflow has only one action -- log history value of the field Days.
When I upload a document and change the value of the field Days to 5 in the dialog, the workflow still shows the default value of 3.
The workflow works fine on item modified if I use the dialog "modify properties".
I understand that uploading a document is 2-step internal process: adding and then editing properties. This is by design to be able upload multiple files and skip validation for required fields.
However, this behavior looks very counterintuitive.
What would be suggestion or workaround ?

Thanks

Additional information.
I investigated to sequence of events.
When a document is uploaded to SharePoint after clicking a button "Upload", my workflow starts, responding to Start on item added

This happens before a dialog form with all the fields is shown (in my case -- only one field - Days).
This can be confirmed by looking in a hidden list (Lists/NintexWorkflowHistory).

When I enter data in the form and click Save, the workflow does not start on Start when items are modified 

Therefore I don't see the value I entered in the form dialog and cannot use in email (yes, it was my goal).
Is it a known issue, a bug or by design ?
If by design, what can be done ?


When I upload a document and change the value of the field Days to 5 in the dialog, the workflow still shows the default value of 3.

you likely read the value from item property, right?

item property holds value valid at the timepoint of workflow start, it doesn't update with any further item/document changes.

this is by design

to get actual value from list/library you need to read/lookup it up on your own.

in workflow you can eg. use set variable action with a config like this

(it reads in current value of 'num' list field into 'varA' variable)

205795_pastedImage_5.png

When I enter data in the form and click Save, the workflow does not start on Start when items are modified

workflow doesn't start on change event since it is already running by a new event. you can run only one instance of a given workflow on an item at a time.

that's by design as well.


Thank you, Marian
In your answer, everything is almost correct.
I tried what you suggested.
I'd like to challenge the option you proposed for reading actual value from library.
When we try to read this value using look up, it's still has initial null or default value for the field.
When workflow on item created starts, the file is already uploaded and resides in the document library with all these defaults.
Reading the value will give the initial value.
When we enter the field value and click "Save",  the  on item modified workflow does not start as you explained.
    


When we try to read this value using look up, it's still has initial null or default value for the field.

were you reading it before closing the dialog? then of course new value wasn't saved to the document yet.

you have to read once you are sure dialog is closed/saved.


I would like to read values that I entered in the form that appears when the item is uploaded.
However, as I wrote, they are not available in the workflow.
Workflow ends before I click save.

When I click Save, on item Modified workflow does not start.



how do you have configured library's option " Require documents to be checked out before they can be edited?"

if you set it to yes, workflow would wait in Starting status until you confirmed the dialog.


Reply