User Tools

Site Tools


servicenow_salesforce_content_version

This is an old revision of the document!


ServiceNow to Salesforce Content Version Configuration

Before continuing with this configuration, be sure to follow the steps from the ServiceNow and Salesforce Configuration page.

Salesforce content version is another form of attachments. ServiceNow only has attachments and will only send out “attachments.” The only configuration needed for Salesforce content version is a transform map so that it can be transformed into an attachment.

Transform Maps

Refer to the images and scripts below for an example on how to configure the transform map.

Table Name:

return "incident";

Table Sys Id:

var gr = new GlideRecord("incident");
gr.addQuery("correlation_id", source.u_linkedentityid);
gr.query();
gr.next();
return gr.sys_id;

Once the field mappings has been created, it is necessary to create the onBefore script to correctly process the content version attachments and insert them.

ignore = true;

var sysAtt =  new GlideRecord("sys_attachment");
sysAtt.addQuery("content_type", source.u_filetype);
sysAtt.addQuery("file_name", source.u_title);
sysAtt.addQuery("size_bytes", source.u_length);
sysAtt.query();
sysAtt.next();

var gr = new GlideRecord("sys_attachment_docs");
gr.initialize();
gr.data = source.u_bodycontent;
gr.length = source.u_length;
gr.sys_attachment = sysAtt.sys_id;
gr.insert();
servicenow_salesforce_content_version.1575501256.txt.gz · Last modified: 2019/12/04 15:14 by vinhn