SharePoint workflow Canceled - Coercion Failed: Unable to transform the input lookup data into the requested type


Posted on : Fri, 9th Oct 15 05:56 pm UTC
2314 votes

SharePoint Designer Workflow problem with Lookup column

There is a particular scenario in which you might receive below error if using SharePoint Designer List Workflow.

Coercion Failed: Unable to transform the input lookup data into the requested type.

Workflow Scenario

Consider a SharePoint list called "Employee" with following schema.

Employee Name (Text)
Country (Lookup)


We create a SharePoint Designer workflow to send a simple email with Employee Name and Country when an item is created.

SharePoint Designer Workflow - original

After publishing the workflow, let us see try creating few items and see the outcome.

SharePoint List Employee with entries

Workflow Problem

Though the workflow is pretty simple. We note that it worked fine where lookup values are United Kingdom, United States, Spain, Australia, but fails when the lookup value is blank. It gets 'Canceled' in this case.
If we look at the workflow history, it shows these details -

Event Typ - Error
User ID - System Account
Description - Coercion Failed: Unable to transform the input lookup data into the requested type


The description is useful for us - Coercion Failed: Unable to transform the input lookup data into the requested type.


Analysis and Troubleshooting

This happens when you use a Lookup site column in workflow and the value is BLANK/NULL.
The workflow fails when transforming the Lookup data (blank in this case) into Lookup Value (as Text).
Further steps of the workflow will not be reached and it gets canceled and logs the error.


How to fix - Resolution

The solution to this is converting the Lookup value to string and then using it in workflow stages.

  1. Create a Workflow Local Variable named "country" of type "string".
  2. Modify the workflow by adding an if condition to check if the Lookup value is not-empty (is not empty).
  3. Set the variable to the Lookup Value
  4. Add further stages after the if condition. Add and else condition if required.
  5. Re-test


SharePoint Designer Workflow - modified

After modifying the workflow this way, even null/empty/blank lookup values will be converted to a blank string value.
Make sure you do this for every lookup column if you feel the value can be blank anytime.

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +