I have workflow for document approval. It is configured to start every time user creates or edits list item. Workflow will start with "Run if" which check if "Ready for approval", boolean field in list, is true. If not, it just skips everything and stops. If yes, it will start real approval phase.
The problem is that Run if is not getting correct value from SharePoint. I have simplified the workflow (inside Run if it only puts Ready for approval back to no and saves time stamp to Title-field) and can reproduce problem every time with these steps:
- Upload new file to document library.
- SharePoint will give me page where I can fill metadata. I select "Ready for approval" is yes and press ok
- When SharePoint shows me document library, I notice that my file is in the library. However, Ready for approval is still Yes, title is empty (so it hasn't run anything inside run if -block) and workflow status is completed. So workflow has been run, but Run If block hasn't been executed
- If I now click edit and then press ok without changing any values, workflow will fire again and this time Run if -block will be executed as it should have been on the first time
I have tried following things to solve problem:
- Put "Commit pending changes" as first element in workflow -> doesn't work
- Put one minute delay as first in element in workflow -> now Run if clause will be executed. However, in this case when Nintex tries to set Ready for approval back to false it will crash and workflow will give Error occurred status
It seems that for some reason Nintex will receive "Ready for approval" field value wrongly and SharePoint hasn't really updated the value yet.
Could someone help?