cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Coercion Failed when updating lookup field

I am trying to update a column (called zone) in the SP library that is a lookup field on a list (also called zone). I know the ID of the lookup item that I want the column to be updated to but I am unsure how to set/update this value in the SP library.

I have been doing a lot of googling and it seems I need to set the ID of the lookup item to the zone column in the SP library. I am doing the update (as below) but I keep getting the coersion error. What is it that I am missing? I have written out the ID of the item in the list I am looking up and I can see its the correct ID number but I just don't now how to set/update it correctly

Please help!

Thanks

Cameron.

Reply
10 Replies
Highlighted
Automation Master
Automation Master

Re: Coercion Failed when updating lookup field

Hi Cameron,

I can't see any error in your configuration as you are right about using the ID to update the lookup column.

Maybe you can try to play around with the return value of your ID field. As you see in your screenshot you have the "three dot"-button beside your Zone's ID field. If you click this button, you can normally chose between different data types for your returned value. Maybe another data type could work for you. I think that a string should work, but you never know...

Or you can try to lookup the ID in a separate action and save it to a variable you then use to update your field. Maybe something get's messed up while trying to update your lookup field directly with a list lookup.

Regards

Philipp

Reply
Highlighted
Automation Master
Automation Master

Re: Coercion Failed when updating lookup field

It appears correct. What type is the NumberVar variable

Reply
Highlighted
Automation Master
Automation Master

Re: Coercion Failed when updating lookup field

Agree Philipp Lucas​. I would suggest to use Set Field action instead of Update Item.

Reply
Highlighted
Not applicable

Re: Coercion Failed when updating lookup field

Hi, cameron irvine​! Keep us posted on your progress!

Thanks,

Frank

Your community manager

0 Kudos
Reply
Highlighted
Not applicable

Re: Coercion Failed when updating lookup field

Hi Philipp,

Thanks for your advice. I have taken on board your suggestion and changed the workflow. I now do a query list lookup to get the ID of the item in the lookup list and store it in the numberVar (its actual a string). I have confirmed that the ID its returning is correct

Then I set the ID into the zone field but I still get the same error. I have tried all the return types but all result in -

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

Any ideas what to try next?

Thanks

Reply
Highlighted
Automation Master
Automation Master

Re: Coercion Failed when updating lookup field

When you enter the ID manually without using a variable or a lookup in the update item/set field value action, does it work?

Reply
Highlighted
Not applicable

Re: Coercion Failed when updating lookup field

Hi Philipp,

Yes it works in that it updates the lookup value but it still errors with - Coercion Failed: Unable to transform the input lookup data into the requested type.

Any ideas?

Thanks

Cameron

Reply
Highlighted
Automation Master
Automation Master

Re: Coercion Failed when updating lookup field

It does the correct thing but still throws an error? That's very very odd...

I would re-create the workflow on a different site collection (even web application if that's possible). If the error exists there as well, I would try to contact the support, as it is very unlikely caused by your workflows or sharepoints configuration.

Sorry, have no more ideas what the reason for the error could be.

Regards

Philipp

Reply
Highlighted
Nintex Newbie

Re: Coercion Failed when updating lookup field

Cameron,

My experience shows that the variable used to set the lookup field needs to be a text variable. I know it seems counter-intuitive. Verify that the one your using "numberVar" is in fact a text variable, and it not, create a new text variable and try it.

Good luck,

Gerard

Reply