Introduction #
We already learned about how to export binary data to Salesforce. Now we will learn about How to export attachments to an Account’s business by using ContentVersion. Sometimes, the user wants to import only attachments to the Account business. SKYVVA has a limitation which can push file (Base64) around 1.6MB per transition. So if the user wants to import many files to the Account.
How to export Attachment to Account by using ContentVersion? #
Pre-require #
- Create a MetaData provider and repository for the upload message type
- Connection destination and create an adapter
- Create Integration and Outbound Interface
Case A: Configuration of pushing SObject and attachment in the XML, JSON file. #
Step 1: We need a Repository to upload the structure for mapping. For instructions on how to create a MetaData provider, repository, and message type, refer to the following guide for metadata providers. #
[su_box title=”Note” box_color=”#2a8af0″ title_color=”#000000″]First, we need to upload the XML structure that is the same as the data we want to export to Salesforce.[/su_box]
- Create Repository
Create Message Type
- sObject: Type Plain structure
- Account: Type Salesforce sObject
- ContentVersion: Type Salesforce sObject
- sObjectRepository is created
- Message Type is also created and it looks and feels in a hierarchical arrangement with sObject Account & ContentVersion
Step 2: We go to the Agent control board to connect the destination. How to use the Agent control board. #
– How to use Agent Control Board (New)?
- Connection Destination in Agent Control board
Step 3: Create an Adapter in the Agent control board, We need the Adapter to transfer the data from one System to another system or computer. Here’s an example below. #
- Go to the Adapter on the Agent Control Board
- Create Agent Adapter property
- filetype: XML, JSON
- filename(extensions): XML, JSON
- Hit button Ping Connection
The adapter (outbound) is created successfully
Step 4: we need an Outbound Interface for exporting data from Salesforce.
- Create Integration and Outbound Interface with Message Types that we had uploaded.
- Put an adapter, MetaData Provider, Repository, and Message Type, and click the button save.
[su_box title=”Note” box_color=”#2a8af0″ title_color=”#000000″] Source Name we choosing ContentVersion. [/su_box]
- Scroll down to Outbound Adapter
- Open Mapping
- Account (Source) to Account (Target)
- Name
- ContentVersion (Source) to ContentVersion (Target)
- FileExtension, PathOnClient, VersionData (required fields)
- Select ExId’s
- Save
- Select your Interface
- Click on the Manual Process button
- Select the Radio button “Manually select the sObject using the Query Builder?“
- Click on Next
- Select the Account Object and Name field related to it
- Write Query SELECT Name FROM Account
- Scroll down to Execute Query Result
- Select your Account
- Click on ok
[su_box title=”Note” box_color=”#2a8af0″ title_color=”#000000″]User Account having Note & Attachment file.[/su_box]
- Now click on the Send Button
Go to Message Monitor
- Select your Integration & Interface
- Click on the search button
- Output Result for XML file
- Output Result for JSON file
- Copy this link
iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAACvZJREFUeNrkWwlwE+cVfiutJMuSjQ0B7NJMOWzaQnpg2pRAg+kk03SAcoVgCNBymZqQcMyEBAbMHUjBYGghgGmmIU1sjrQhBrdNaYcrk5QkctKm7Qw4HGmL7RCCjQ5Lu9Lu9r1fh7WSbUmrdWfc/p43Xq3+/9//e+997/2HloOoMsk/JQf/bUCZgjIQena5gXISZVOt6WRr+CYXBXYe/qtEIdBg9BnB2mTpkUi9+QJIGVL4I4FdiaBfigAOgf0lXduvZ8KAun5gbc7o0eb15vng5oRb4B7UFr41n0BzITe+TpbNrc+Ge1/Lg/+l8q/pzdBS5AxbehAf4myO7ZoVBhzvBzL+dWfxDPaqPmcgbYxeQ7c9jzCJOX56LotPfChAQf/aPiArSrc8lPj06aTPwTXMA5I1XqE5jizoeyYXTC2mbnk+Ybu24t90OYUADzSghs03Td1iXeELIvyzrKlDoJGoMtLFlJF/7B6w/92m+xgIG+fmQLErA3nmVo1mkGX9wcoI8hMEK1sT900KaSy5DYOfs4BBZxdX0HP5Gwbw3ycBH76hdAPgW5PuJAU2WkHUpn9Nb13HIQYCECYrH3mYzvz1FgjgvN+TcjtqY383E6wf6zcHEP3+yHXEwnq79O2prWm1HfDTvvoETMQlSRLDqLawjoCd32sDcYBfu0WwbWuxG7LPZqZvXVFUYQtaWEfAgT4y3B3vSrsf6iPzHQxgbZz2YIXiJ/6SdZVoDpNL68Th1ukuDD7p90V9tDzqgtyXszT3QWClkCEVUNQW1iNKC0P94P2GoBs12h7wgfVtM1iumDS7sxJjyHYL6wC4dZ5b99TmnO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dqVli5mzy77SRkYMXtkLwquYz11XjAXmsA0lIfcdVnQNPV2nI3j8jAFnTXPPANjkGfRMn3qVBiBViI+U9mLLjZv7lzmuide/w08VlISPPbwY8qSgicBYXcmKxGwy5cvx+XWqqoq1t+i0lL2mZRzHkGeO3c2UmfTxk0MYCnWycfAWLq4FK1fBY2NN6F3efAHLzJmlZbdLmipDCqUR4uT5TucePCFfOSLBcgXctXYgdkwGEWHd/rf2NgIS5F/v8CHL0CP+DlylBTW0UF09GwuWpxOJwLaCLNmzYKdFRUs6O2q2KWqcxOB1VTXwEyqs6sCmvC5hw4dAiu6rqUouNhpqbwLkgvTlUMA9+ngbDFrZiZwtuCKyTjYFHHpG5zdMNBYwGPi9sNWDALP79jRYUivQ76QtcIApNAm969eeQUuvfsebNq0EV6trsYBVzDLqr2pg1wfKmfPngXH+w4YN24ca0sAY8uhQwdh4g8nYhoaCovRpdlCJ7RL6XOI4DrVnpPv7LoLmcXB34MY8w3A+Q3A92Ecv0HvPFD4WyHWC9Cy9LPkJg4hjirQfT9k0bP0rugLtmLG8z2qlzy8dR64u+VOpxMV4qUky9CTSq9VvaHXjF50/M9e8oh7jYcs7axsAf8Vsf2QLep8tacUHjmbs7w3ZI6xhd/OCr7GE64Q+6IWzVSEf/hA6VkGDe50FJrBmGsEzsjgtYbAnmT7XdEV/x9exfuPAAMA9OtPwEmPWQAAAAAASUVORK5CYII=
Go to Base64 to File on the web browser
- Paste the link here (Base 64*)
- The attached file is shown here
Case B: Configuration of pushing SObject and attachment binary (base 64 data) type File, jpg, png, pdf file. #
Follow the same above steps till mapping (step 2)
Step 3: Create an Adapter in the Agent control board, We need the Adapter to transfer the data to an outbound file folder. Here’s an example below. #
- Go to the Adapter on the Agent Control Board
- Create Agent Adapter property
- Content Format: Binary
- filetype: Binary
- Check: Create Reference File
- Hit button Ping Connection
The adapter (outbound) is created successfully
- Open Mapping
- Account (Source) to Account (Target)
- Name
- ContentVersion (Source) to ContentVersion (Target)
- FileExtension, PathOnClient, VersionData
- Select ExId’s
- Save
- Select your Interface
- Click on the Manual Process button
- Select the Radio button “Manually select the sObject using the Query Builder?“
- Click on Next
- Select the Account Object and Name field related to it
- Write Query SELECT Name FROM Account
- Scroll down to Execute Query Result
- Select your Account
- Click on ok
[su_box title=”Note” box_color=”#2a8af0″ title_color=”#000000″]User Account having Note & Attachment file.[/su_box]
- Select the Radio button “Use the SOQL statement on the interface to select the sObject”
- Now click on the Send Button
- Go to Message Monitor
- Select your Integration & Interface
- Click on the search button
- Output Result
Summary #
In this tutorial, we have learned about How to export files to ContentVersion in Salesforce. This function is useful for users who want to export files to Business sObject. We need to follow four steps to this function