I need to parse a yaml file and import it to salseforce contacts... I know how to create new users using the databasedotcom gem, but i don't want to create new users from a rails generated html form...i want to import the contacts from a yaml rather...

As salseforce allows to import contacts from csv files...so is it that i can convert the yaml file to csv and then push it to salseforce...

I searched for some gems at github...but not much of any help...or do i need to do it from the scratch...

Also i didn't find any gem to push contacts to salseforce even if the file format is csv...

I don't want to use dataloader or apex-code or something...i've a developer edition account, and a rails console...just that...

maybe...i'ld try to first parse the yaml file to a hash or something and the push it to a csv file using yaml gem and csv gem...but then i don't have any clues to push that csv file to salsforce...i don't want to use dataloader or apex-code or something

Any help is appreciated...


  • what's the source of te yaml files? is it highrise export? Sep 23, 2012 at 17:51

2 Answers 2


If you don't want to use dataloader or do it through the import wizard in salesforce directly I think you're going to have to use one of the Salesforce APIs - your best bet is the Bulk API which is designed for larger data sets. The databasedotcom gem works off of the REST API which is more for smaller transactions. I found this salesforce_bulk_api gem that should work with the Bulk API if you don't want to start from scratch but I know nothing about it.

The Bulk API doesn't support YAML so you will have to convert to either CSV or XML - the documentation will explain the format you need better. It may be that the gem can handle that for you, I'm not sure.

  • bro...thanks a ton...i posted the same question on stackoverflow too...but found no help but some stones and "why would you like to do that kinda stuff"...anyways no offence to anyone...as we programmers are kinda grumpy....but yeah i'm headed in the same direction...and found this...code.google.com/p/sfdc-bulkapi-demo/wiki/Setup...it's java based but i'm looking to the gem also...and yeah the yaml to csv thing is a still a headache...i've some algo...but need to work around...yeah i won't give that rest api more tries...the data loader is fine....
    – user477
    Sep 22, 2012 at 15:57

If you have rails console, the best way to get started is with https://github.com/heroku/databasedotcom. You can do pretty much everything with that

  • Thanks bro...but i did it already...using a client then authenticate it then materialize the client and all those stuff and storing the yaml data in a hash and then using Client.create method i pushed it to slasforce.But the project needed to comprehend more complex(nested) yaml file so i kinda have to work around the algo only.
    – user477
    Sep 24, 2012 at 18:14
  • ok. then it's more about yaml parsing task - unfortunately no experience with that. Sep 24, 2012 at 18:58
  • I made a simple yaml file and push it to salseforce, rails is the starring transporter here.youtube.com/watch?v=9sVT3I1Ibcc
    – user477
    Sep 25, 2012 at 14:23

You must log in to answer this question.