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
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.
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 -
|Error||Coercion Failed: Unable to transform the input lookup data into the requested type.|
Any ideas what to try next?
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.
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.
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.