Symptoms
Add List Item Attachments - Data Field Error
Diagnoses
I am moving a file from a site in SharePoint 2013 that is in 2010 compatibility mode, to a site in SharePoint 2013. I used the 2010 event wizard to download the file and save it as a binary data field. I then used the 2013 event wizard "Add List Item Attachment". I am getting the following error in the wizard: Data at root level is invalid. Line 1, position 1.
Resolution
I was able to use the Upload Document event via data label. Below is what needs to occur...
1.) Create a workflow that is mapped to the 2010 doc lib that fires when an item is added.
2.) Throw the ID in a data label.
3.) Grab the document name by SMO Get List Event and store the Name in a Data Label. Call the data label 'Name' the data type is string.
4.) Fire of the 'Retrieve Document' method throwing the Content in a data label. Call the data label 'Content' the data type is string.
5.) Create a data label called 'OpenTags' and store the values '' in there as a data type string.
6.) Create a data label called 'CloseTagsNameOpenContent' and store the values in there as a data type string.
7.) Create a data label called 'CloseTagsPostContent' and store the values in there as data type string.
8.) Throw in a 'Upload Documents' event and when you select the source throw in the data labels in the following order...
'OpenTags' 'Name' 'CloseTagsNameOpenContent' 'Content' 'CloseTagsPostContent'
Finish the wizard, and fire off the workflow and the doc stored in the 2010 library will then be uploaded to the 2013 library.