Site Work Flow Variable Not Picking Correct Date

  • 24 January 2019
  • 3 replies
  • 0 views

Badge +3

I have list A which has a number of date columns which are set by a list workflow using Calculate Date columns. List B is used to input the start date.

The list workflow(Red) in A  Uses a Run If the status is Ready and the Record should be included (a Yes/No).

It then does a Calculate Date which in this case goes to List B and from a column called Set Date To grabs the date does it's calculation and stores the new date in a variable.

When I force the list workflow to run it works perfectly, grabs the date and places the calculated dates in the correct columns.

What I have running now is when the date is updated in List B it runs a List workflow (Blue) kicks off a site workflow (Green), which queries List A for all the records which are set to Ready and Yes. It then stores these in a collection variable. I am then running a For Each and calling a Web Service for each record collected and running the above list workflow (Red).

When the List Workflow (Red) is being started by site workflow (Green) the date variable is being set to 01/01/0001.

To validate this I inserted an email function in the list workflow (Red) just before the update and it sends me emails for all the records which meet the criteria For Each. I see the date variable has been set to 01/01/0001.

I have included the workflows in an sattachement

Any ideas?


3 replies

Userlevel 5
Badge +14

I'd guess you're hitting a race condition.

you (manually) update an item in listB.

the change starts a list workflow which in turn starts a site workflow. I guess you do not wait for site workflow to be completed. so list workflow ends and updates its status in the item.

then workflow on listA queries changed date value (that fired the chain of workflows) from list B.

I guess previous listB updates are still being persisted to the list item by sharepoint when you perform query from listA's workflow, hence you get a empty/senseless value.

 

try to add a pause action at the very beginning of the red workflow to delay its execution until changes are persisted.

or try tohand over changed date value from blue workflow to green one and ten to red one as a workflow parameter.

Badge +3

What ended up being the issue was the Call Web Service was corrupted. Once I deleted this, saved the workflow and added back the Call Web Service it started working fine.

Userlevel 5
Badge +14

hm, that doesn't sound to me to be real reason. call web service action nor the whole green workflow has anything to do with date field value.

that might be just a coincidence or momentary state of your environment

Reply