Created
December 1, 2020 22:45
-
-
Save erik4github/17aa0ce03977046741deeb7162fbdda3 to your computer and use it in GitHub Desktop.
Export records via SFDX into CSV or JSON
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
#!/bin/bash | |
# CSV with SOQL example | |
sfdx force:data:soql:query -q "SELECT Name, Username, Email FROM User WHERE IsActive = True" --resultformat csv | paste -sd '\n' >| sf_users.csv | |
# JSON with SOQL Example | |
sfdx force:data:soql:query -q "SELECT Name, Username, Email FROM User WHERE IsActive = True" --resultformat json >> sf_users.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment