Introduction
In this tutorial, we will explain about how to export XML using Agent File Adapter. Agent File adapter for producer uses for writing data from salesforce to file. To use the Agent File adapter for Producer, we need to configure the Agent Control Board, and we need to create an outbound Agent File Adapter.
Pre-required
- Create Integration
- Do configuration on the Agent Control Board
- Create Agent File Adapter (Outbound) on Agent Control Board
- Create Metadata Provider, Repository, and Message Type
- Create Outbound Interface
- Check the Cache monitoring status
How to export XML using Agent File Adapter in the protocol: SFTP?
Step-1: Create Integration and test connection destination
Create new Integration by following the guide, the link is given below:
- Navigate to AGENT Control Board as shown below.
- In the Configuration tab enter the connection destination name and click on the button “Continue”
- Fill in all the required details
- Click the button Ping Agent Connection
- Fill in all the required details
- Click the button Ping Salesforce Connection
Step-2: Create an Outbound Agent File Adapter on the new Agent Control Board
- Navigate to the Adapter tab after that click the button New
- Name: any Name
- Type: Agent File
- Direction: Outbound
- Protocol: (your SFTP)
- Host: (your Public IP Address)
- Username: (your SFTP Username)
- Password: (your SFTP password)
- Port:( your SFTP Server Port)
- File Type: XML
- Folder: (your folder location SFTP)
- File Name: (your File Name)
- XML Root Tag: your root tag of XML
- File Handling Mode: (Choose File Mode)
- Connection Destination: (your destination name)
Step-3: Generate Message Type from the file
- Create Metadata Provider
- Create Repository
- Go to the Repository details page then click the Open Editor button
- Input an XML format
- After that, you get the Message Type generated as a template from the file
Step 4: Create an Interface
- For creating the interface need to follow this guide: https://docs.skyvva-dev.com/docs/tutorial-v2-41-lightning/what-is-an-interface-and-how-to-create-it/
- Create an Outbound Interface for Operation(upsert), Choose Adapter, Metadata Provider, Repository, and Message Type
- Mapping
Step-5: Check cache status
- Go to Agent control board then click Cache Monitor
Step-6: Manual Process
- Navigate to the interface tab and select the interface
- Click on the Manual Process button and choose the second radio
- Click Send
- As a result of message monitoring, the record has been sent from salesforce to file
- XML File
For CSV, Excel, and JSON files, users can do the same as XML files. But the user only needs to change the file protocol, adapter, and properties accordingly.
- Select type: Agent file
- File extension: choose your file extension
For few extension use (.CSV, .xlsx, .xml, .json)