OK so this has stumped me. So I have a query that sets some string variables based on an ID. The query runs fine if I execute on the spot but many of the fields I am returning are not populated. I didn't expect that to be an issue.
The object of this workflow is to copy data from one table to a table in another site- however the fields are all optional so some may be blank and I need to work with that. I am however getting a Coercion Failed: Unable to transform the input lookup data into the requested type in the Create Item in Another Site. There are 50+ fields I am working with so creating a Create Item in Another Site based on which fields have data is just not possible as there are too many combinations. This error occurs even if I am only populating one field (which is a text field and has data).
All the fields are either date, text or choice fields. I want to leave the date fields blank if they are blank in the original data so I hate to have to populate them if that is the issue. However I even created a blank list with only one text field (that has a text value) and even that fails with the Coercion error.
So Now in my blank list I created a workflow that just puts text values into the list. Even though when creating the action it lets me select the list and fields when it runs it gives me the error Unable to find list to create an item in.
ETA: Updated to reflect further testing which revealed a different issue.
Solved! Go to Solution.
it looks like you are working with lookup fields.
indeed, if you read not populated lookup field you get empty value/strings.
however, you can not write empty value into lookup field.
you've two possibilities how to workaround this
- check the source value for emptiness, and if it is empty write 0 (zero) value into lookup field
- or do not query lookup fields into collection, but rather use inplace lookup within create item action.
something like this (lkps are both lookup fields)
I was just using a RunIf Statement - RunIf Variable isNotEmpty
However I think I was mistaken and it is getting past this check and failing at Create Item in Another Site.
This would be great but I am querying an item via a Site Workflow so the Current Item option isn't available. I think all the fields are free text or dates however. I'm looking into seeing if it is failing on the dates or all fields.
I thought since it was able to find the list and show me the fields there would be no problem creating the item in the selected site. However I'm guessing because it is an different application - it is considered cross domain and therefore the "Create Item In Another Site" does not work.
So I've scrapped that idea all together and moved to Web Services - I have been able to successfully use the UpdateListItem from the List.aspx services to add a test item so I am able to move forward. I do appreciate all the helpful suggestions!