SPServices CopyIntoItemsLocal

Mar 26, 2014 at 7:15 PM
hey all,

We're slowly replacing some of our more basic InfoPath forms with custom HTML forms to deploy single-page applications more easily. But, I have a requirement to maintain the connection to the original document library containing the the existing Infopath Documents/Items whatever you want to call them.

I've managed to create the form just fine and I can pull data from the original list just fine. What I can't do is push new items into the list. I can get the name of the template for the list using GetList and then finding the DocTemplateUrl attribute on the List element, which gives me my Source Url (with http:// appended). I create a DestinationUrl based on the title of the new document and generate it this way:
     operation: 'CopyIntoItemsLocal',
     async: false,
     SourceUrl: ('http://' + retrievedTemplateUrl),
     DestinationUrls: [('http://Site/Library/' + documentName + '.xml')],
     completefunc: function(xData, Status){
          if($(xData.responseXml).SPFilterNode('CopyResult').attr('ErrorCode') != 'Success'){
          } else {
               //do some stuff
The problem is that the Result of the operation is empty. It comes back with a CopyLocalResult of "0", presumably meaning no syntactical or schematic errors are present, but it doesn't actually copy anything.

Can this not be done within one list? Meaning, I can't copy the template.xsn to a new xml within the same library? Do the libraries have to be different? Or am I missing something else?