SK SKYVVA Documentation

118. How user can import business and attachments that are embedded in one file (Content Version) ?

Introduction

Base 64 String is a group of binary-to-text encoding schemes representing binary data in an ASCII string format by translating into a radix-64 representation. The term Base64 originates from a specific MIME content transfer encoding. To help customers who want to import SObject and attach a file (base64), we have methods that can solve the problem. Now I would like to show you how to push binary data and SObject in the same XML file, but it will store the attachment in Attachment Object. The binary data is the data that has encoded with base64 string.

How to import business and Attachments that are embedded ContentVersion

Pre-require

To import SObject and attach a file (base64) to it. The SObject and the file are embedded in the same XML file. See in the picture below.

So to be able to integrate hierarchical data like that, we need to use IntegrateV3 inbound processing. We have to push a file to Attachment and pushing the file to Attachment SObject. [su_box title="Note" box_color="#2a8af0" title_color="#000000"]The file is base64 (binary text) not a physic file.[/su_box]

Now we need to choose the Target SObject to push the file to Attachment SObject based on the mapping. Let’s open the Mapping tool and see how we map in the picture below. [su_box title="Pushing big size of child node" box_color="#2a8af0" title_color="#000000"]Please note that we have limitation which can push file (based64) around 1.6MB per transaction. So if you want to push many child (the files) per parent you can map only Child node and use the VLOOKUP function to find its parent. And make sure that the parent exists in the Salesforce (We should push the parent first). [/su_box] Pushing file to ContentVersion

Before you are able to connect to the Agent side you need to set up the remote site on Salesforce by going to Setup and search for remote site setting and then create a remote site.

Now let’s configure the Agent server and click Ping Agent Connection. See in the picture.

[su_box title="Note" box_color="#2a8af0" title_color="#000000"]Actually, we have package size option but it works only with the root message. E.g. per a parent has 10 child it will send 1 parent and 10 child per transaction (if we set package size=1). We do not support splitting the child message based on package size yet. That’s why we make the child become a root node in mapping. So you will push only child and you can decrease the package size like you wise (when you get heap size error). Please also be sure that we have an External field of a parent for using VLOOKUP.[/su_box]

Summary In this tutorial user learns how to import business and attachments that are embedded in one file (ContentVersion).

Open this article in the interactive viewer →