Created
November 30, 2017 20:57
-
-
Save mshanemc/f275b3440840fd41278b368e76b4955b to your computer and use it in GitHub Desktop.
Moving data around in sfdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# query the data like this gives you a json file | |
sfdx force:data:tree:export -q "select Bikes_Sold__c, Region__c from Dealer__c" -u cg1 -d data | |
# Problem: there's no query to CSV for bulk api upsert use. So we have to parse/convert that json. | |
# uses npm packages jq and json2csv | |
# convert to csv for bulk API | |
cat data/Dealer__c.json | jq .records | jq 'map(del(.attributes))' | json2csv -o data/Dealer__c.csv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment