Skip to content

ThyWoof/sfdc2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

sfdc2csv.sh

bash command line to export a SFDC report to CSV

Introduction

Salesforce.com offers different ways to export data to flat files but it does introduce unnecessary complexity in the process.

This small bash code demonstrate how you can easily export SFDC reports to CSV by using the command line, and standard tools like curl, and sed.

Workflow

  1. curl to call the SFDC API login entrypoint
  2. sed to parse the SOAP response
  3. curl to validate the SFDC report endpoint
  4. curl to export the report to CSV

Parameters

-s <URL>   : SFDC domain URL
-r <UID>   : SFDC report unique ID
-t <TOKEN> : SFDC account token
-u <USER>  : SFDC user name
-p <PASS>  : SFDC password

Example

./sfdc2csv.sh \
  -s https://test.salesforce.com \
  -r 00O80000005Ww9g \
  -u [email protected] \
  -p my_password \
  -t get_your_token_from_the_account_setup_menu

It is better to store both the password and token on a file to avoid display them as clear text when calling the script. For example:

./sfdc2csv.sh \
  -s https://test.salesforce.com \
  -r 00O80000005Ww9g \
  -u [email protected] \
  -p $(cat password_file) \
  -t $(cat token_file)

About

bash command line to export a SFDC report to CSV

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages