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!

Share This Blog
Related Articles

Salesforce CPQ (Configure, Price, Quote) is a powerful tool that enables businesses to streamline their quoting process by providing advanced configuration options. Among its many features, Multi-Dimensional Quoting (MDQ) stands out as a powerful capability that allows sales teams to create more detailed and flexible quotes for complex products. In this blog, we’ll dive into […]

Read More
Dynamic Search Filters in Salesforce CPQ

Salesforce CPQ (Configure, Price, Quote) is a powerful tool that allows sales teams to generate quotes with speed and accuracy. One of the key features that makes CPQ so flexible is its dynamic search filter capability. In this blog, we’ll explore how you can create dynamic search filters in Salesforce CPQ to make your quoting […]

Read More
How to Create Quote Templates Customization Methods

The objective after completing a quote is usually to produce a precise and expert quote document for clients. However, without the proper procedures in place, quoting can be difficult, error-prone, and time-consuming. Salesforce CPQ (Configure, Price, Quote) streamlines the process and improves quote accuracy by assisting with the setup and administration of quotation papers. By […]

Read More
Boost Performance with a Robust Trigger Framework in Salesforce

Boost Performance with a Robust Trigger Framework in Salesforce If you want to make sure of scalability and performance in the Salesforce development, managing Apex triggers is a must. With a trigger framework, you get a structured approach to organizing and maintaining trigger logic. This way, developers can follow the best practices while maintaining the […]

Read More

When it comes to Salesforce development, efficiently managing and deploying metadata is important to maintain streamlined operations. With the help of Unlocked Package, you can easily achieve this. It is specially designed for business’s internal use and allows businesses to develop and manage modular applications. This blog will walk you through the importance of Unlocked […]

Read More
How Salesforce Data Cloud Streamlines Data Management

The Data Cloud integrates your company’s data onto Salesforce’s Einstein 1 Platform. It provides each team with a comprehensive customer view for a better experience. The Data Cloud consolidates disparate data sources into a unified model, facilitating easy access and comprehension. It encompasses various data types such as web engagement and more from both internal […]

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