Oftentimes, companies want to move resources into Salesforce. It only makes sense, being that salesforce is one of the top Customer Relationship Managers (CRMs) available right now. There are loads of benefits to storing data in Salesforce, including security, organization, and data recovery. What is the process of moving data to Salesforce like? Let’s talk about CSVs.



  • When working in Rails, all your data is stored in a database. First you’ll need to pull the required data from the database and put it inside a CSV file, using the psql command line. CSV stands for comma-separated values, and is a way of storing table-like data in a text format.

user$ psql
user=# \c database
database=# \COPY my_table TO 'filename.csv' CSV HEADER

This will create a CSV file in the chosen directory with the contents of the table from your database.

  • From here, we will begin to upload our CSV file to Salesforce. First you’ll need to go to SETUP > DATA > DATA IMPORT WIZARD. Where you can find and launch the wizard to import data.
  • Once the wizard is launched you will be asked to choose what type of data you are importing. This is basically asking which Salesforce object you are looking to import, whether it be contacts, leads, or a custom object you created. Select which type you are planning to import.

  • Next you will be asked what you want to do. Since we’re importing new data in this tutorial, we will select “Add new records”

  • After that, select the CSV file you would like to import, select the correct Character Code, and locate the option by which the values are separated by. The character code and separator, will more often than not be the default values Salesforce sets. After this step, then just press “Next” at the bottom right of your screen.

  • After pressing “Next”, you will be directed to a new page asking to assign Salesforce objects to the CSV headers.

Some headers will be mapped already, as Salesforce typically knows what some values will be mapped to, saving you time. However in this situation, our contact_name and acctount_name headers are not mapped, so we will have to do it manually, starting by clicking “map” on the left side of the screen.

  • Mapping an object to a header is quite simple, as all you need to do from the pop-up box, is find the related field, or fields, and select them to map.

Now after repeating that for each un-mapped header, you are ready to begin importing.

  • Click the “Next” button at the bottom right corner of the screen for a review of what is being imported. From there, just press “Start Import” to begin putting your data into Salesforce. Note: This can take some time depending on how much data you have.
  • After the import you should now have a list of objects available to you on your Salesforce homepage.



Now that you know how to import your data, you have the power of Salesforce on your side. You can create graphs, organize your data, as well as many other ways to improve your business. Data can also be updated and new data can be added at any time, so you can always have Salesforce up to date with the rest of your company. If you are looking to centralize your data in either Salesforce or Rails, rather than both, look here to help you make a decision.

One Comment

Leave a Reply