AnsweredAssumed Answered

Combine multiple attachment chuncks

Question asked by elisha.hersberg758558 on Feb 6, 2018
Latest reply on Feb 8, 2018 by elisha.hersberg758558

salesforce attachment salesforce connect  servicenow

I work on an integration between ServiceNow  and Salesforce.

I want to get Attachements from ServiceNow and send them to Salesforce.

 

 

On ServiceNow I can query sys_attachment table and then I can query sys_attachment_doc table where sys_attachment = sys_id from the previous call.

 

The result is a list of sys_attachment_doc  records which have to be combined in one document and send them to Salesforce.  

 

I use the combine function to do this but it generates one xml profile with multiple data child elements inside.

I need to combine all data child elements into one element.

 

My document after combine:

<?xml version='1.0' encoding='UTF-8'?><ns1:sys_attachment_docResponse xmlns:ns1="http://www.service-now.com/sys_attachment_doc">
<data>H4sIAAAAAAAAAA==</data>
<data>7XtjdGbb1uYb27YrqNi2baN......</data>
<data>MYVFuJBX7x2Pir................</data>
<data>9nz/QtVWaBw0e................</data>
<data>O9kRg70W49peDiobVz+stuHm...............</data>
<data>4wpG4VxMsGxXmvxl44MC9ZAF..............</data>
</ns1:sys_attachment_docResponse>

 

I would like to have:

 

<?xml version='1.0' encoding='UTF-8'?><ns1:sys_attachment_docResponse xmlns:ns1="http://www.service-now.com/sys_attachment_doc">
<data>H4sIAAAAAAAAAA==7XtjdGbb1uYb27YrqNi2baN..MYVFuJBX7x2Pir.9nz/QtVWaBw0e................O9kRg70W49peDiobVz+stuHm................4wpG4VxMsGxXmvxl44MC9ZAF..............</data>
@</ns1:sys_attachment_docResponse>

 

Outcomes