Question

I'm not really sure how to title this question properly, but here is the problem I am running into:

SharePoint 2013, running a 2010 workflow. The workflow is a reusable workflow, but designed to run on a specific list. Since it is a reusable workflow, there are not a lot of [CurrentItem:FieldName] type of references, instead they're all [ListName:FieldName] where [ID] equals [CurrentItem:ID] type of references. I don't know if this is playing a part in the problem or not.

There is one point in the workflow where it retrieves a user value from a different list, based on the value of a lookup to that other list, then sets a user field on the current item ("Assigned To") to be that user.

The problem is that once the "Assigned To" field is set, all of the properties usually available on a user object in a workflow (Display Name, Email Address, Login Name) are set to the user ID. And the User Id Number property is set to -1.

The field does seem to get set properly - after the workflow runs, the "Assigned To" field shows the correct user display name. But somehow that data is not available within the workflow.

And user fields from the primary list that the workflow runs on do have the correct user object data - display name, email, login are all available.

So does anyone have any idea why a user value retrieved from another list would only have the user ID value available, and not the full set of data from a user object?

Was it helpful?

Solution

It turns out that the problem was not because of retrieving the user value from another list, the problem was the process of setting a user field in a workflow.

Since a user field is essentially a lookup to the User Information List on the site, when you set the value of a user field in a workflow, something about the process does not complete until the workflow ends, so the user value never "resolves" fully until that time.

So in my workflow, after setting the "Assigned To" field, it is in an unresolved state, and any attempts to then get values from it will not work. Once the workflow ends, some other process finishes setting the field value and it resolves, so then on any subsequent runs of the workflow, the value is correct.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top