Salesforce provides various ways to import data from external systems. In addition to using various services, we can also rely on third-party services or create our own custom solution for data retrieval.

However, importing data from a remote FTP server can be challenging because Salesforce does not support an FTP server to be set as an endpoint in Remote Site Setting so we have to use an external service in this case.

To overcome this challenge, there are multiple options available to us.

  • One way is to use a third-party service that provides FTP functionality.
  • Another way is to develop a custom solution using FTP API. This allows us to establish a secure connection between Salesforce and the remote FTP server, and transfer data in a structured manner.

    In this article, we will focus on providing a step-by-step guide on how to use FTP API to import data from a remote server.

By the end of this guide, you should have a clear understanding of how to use FTP API to import data and be able to apply this knowledge to your own projects. Lets’s begin!

Pre-Requisites for Implementing this solution

Here are the things you will need to setup:

  • An FTP hosting service to create an FTP server from which you can connect and upload/download your files.

In this demo, we are using Infinity Free hosting service.

In this, we have to just create an account and host an FTP service

  • Now when you have an FTP service you have to interact with your server. For that, you have to use an FTP client. In this case, we will be using FileZilla as our FTP client.

You can download the FileZilla FTP client from here download link. After downloading the FileZilla client you can connect with your server easily from here.

Put the details you got from the Infinity Free FTP details page.

After connecting your FileZilla Client will show your FTP details and its files. From where you upload files to your server.

After doing this setup you can start building your LWC app in which you can get data and then insert that data into your Salesforce org.

We are using the FTP-API download file service so for that we have configured these parameters.

Building LWC APP

Now Coming to LWC App. We will be implementing the solution we come up with using FTP API.

In this case, we are getting a CSV file from our FTP server and inserting it into the Account object.

Apex callout to download files with API.

JavaScript :

HTML :

Apex class to insert accounts:

js-meta.xml

You can use this code with your FTP username and password and deploy it to see an LWC component like this:

The Upload Files is a lightning input that is set to take a CSV from local storage.

In the lower section, the user can enter the file name which has to be downloaded from the FTP server. After getting data from the CSV it will be displayed in a data table like:

After verifying the data user can press “Confirm Upload” to finally insert records in your Account object.

Conclusion:

In conclusion, FTP API can be a useful tool to import data from a remote server to Salesforce. With the proper setup and configuration, it allows for a secure and structured transfer of data.

By following the steps outlined in this guide, you should be able to use FTP API to import data from your own FTP server and apply this knowledge to your own projects.

Be sure to try out the solution and share your experiences with our development team at HIC Global Solutions. Happy Coding!

Related Articles

In this detailed guide, we will walk you through the significant yet easy steps to configure Email to Salesforce. Without any further ado, let’s get started! About Email to Salesforce As the term refers, Email to Salesforce is valuable for any organization that businesses use as their Customer Relationship Management (CRM) platform. It helps streamline […]

Read More
Guide on CRUD Operations in Node.js with jsForce

CRM developers typically need to integrate Salesforce with Node.js apps. One well-known library for this purpose is jsForce, which provides a comprehensive set of tools for interacting with Salesforce data and performing CRUD tasks effectively. Let’s dive into the blog, where you will understand the use of jsForce to execute key CRUD tasks within Salesforce, […]

Read More
How to Implement Round Robin Assignments in Salesforce Using Apex

Ensuring a proper workload balance and quick follow-ups from internal or external team members, leads, opportunities, or task distributions is crucial. To achieve this, all you need is a Round Robin assignment. In this step-by-step guide, we will walk you through the process of implementing a round-robin assignment in Salesforce using Apex. Here, we’ve used […]

Read More
Best Salesforce Developments Services Provider

In this step-by-step guide, we will walk you through the significant role of Large Data Volumes in Salesforce, and what strategies or practices you should keep in mind. What is Large Data Volumes? In Salesforce, Large Data Volumes (LDV) refers to managing a huge amount of records available in the platform. LDV usually comes into […]

Read More

Salesforce Apex includes numerous built-in text handling classes, and in addition to them, the Pattern and Matcher classes are good for performing complex string operations. These classes enable us to define and work with regular expressions, which are of particular importance for data validation, searching, and modification. In this technical blog, we will find out […]

Read More

Maintaining security and compliance in Salesforce requires effective user access management. This article will lead you through the process of creating expiration dates for Permission Sets and Permission Set Groups, allowing you to automate access removal while minimizing manual work. Know how this functionality simplifies workflows, guarantees compliance, and improves security procedures. Why Use Expiration […]

Read More
Our Location worldwide
Indian Flag India
3rd Floor, A-10, Pegasus Tower, Sector 68, Noida, Uttar Pradesh 201301 +91-1203117884
United States of America Flag USA
333 West Brown Deer Road Unit G – 366 Milwaukee WI, USA 53217 +1(262) 310-7818
United Kingdom Flag UK
7 Bell Yard, London, WC2A 2JR +44 20 3239 9428
Canada Canada
HIC Global Solutions INC
43 Lafferty Lane, Richmond Hill, L4C 3N8, CA +1(262) 310-7818