Is it possible to export multiple SObjects data records without using Parent Child relationship? Suppose there are 2 SObjects Transaction__c and Country__c independent of each other.. I want to export both records in single go.. Is it possible using salesforce cli?

Following is the command I am using to export data using Salesforce CLI:

Command to fetch Transaction__c

sfdx force:data:tree:export -q "Select Name from Transaction__c" -u MyScratchOrg

Command to fetch Country__c

sfdx force:data:tree:export -q "Select Name from Country__c" -u MyScratchOrg

I want to combine above 2 commands in single command without Parent-Child relationship Query.. Is it possible?

1 Answer 1


No, sfdx force:data:tree:export accepts exactly one SOQL query per invocation. It won't accept -q twice, and you won't be able to specify both objects if they do not have a relationship to one another.

For now, you'll be stuck with running the command twice, unless and until SFDX gets more sophisticated export behavior.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .