User Tools

Site Tools


servicenow_salesforce_content_version

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.

Import Set Table

Navigate to the search bar at the top left of your ServiceNow window and search u_sfdc_content_version_import.list. From here, right click on a column header and go to configure > business rules.

Create a new business rule and follow the examples below:

Content version business rule script:

(function executeRule(current, previous /*null when async*/ ) {

    var gr = new GlideRecord("incident");
    gr.addQuery("correlation_id", current.u_linkedentityid);
    gr.query();
    if (!legal.next()) {
        ignore = true;
        return;
    }

    var attachment = new Attachment();
    attachment.setTargetTable("incident");
    attachment.setTargetID(gr.sys_id);
    attachment.setFilename(current.u_title);
    attachment.setContentType(current.u_fileType);
    attachment.setValue(new GlideStringUtil().base64DecodeAsBytes(current.u_bodycontent));
    attachment.attach();

})(current, previous);
servicenow_salesforce_content_version.txt · Last modified: 2020/05/19 11:11 by vinhn