function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sanket VSanket V 

Data Loader Command Line Extract - Is there a way to feed Object name and SOQL as parameters?

Several properties like username, password etc. need to be repeated for every bean in process-conf.xml.
  1. Is there a way to minimize this noise? In other words, is there a way to not repeat this?
  2. Is it possible to pass Object name and SOQL query dynamically from the batch file? 
  3. When exported file doesn't exist, is it possible to force the bean to create it automatically?
<bean id="accountExport"
class="com.salesforce.dataloader.process.ProcessRunner"
singleton="false">
<description>Exports all the accounts.</description>
<property name="name" value="accountExport"/>
<property name="configOverrideMap">
<map>
<entry key="sfdc.debugMessages" value="true"/>
<entry key="sfdc.endpoint" value="https://login.salesforce.com"/>
<entry key="sfdc.username" value="myusername@sfdc.com"/>
<!--Password below has been encrypted using key file,
therefore, it will not work without the key setting:
process.encryptionKeyFile.
The password is not a valid encrypted value,
please generate the real value using the encrypt.bat utility -->
<entry key="sfdc.password" value="db8254a11bbd32cef5cd2f"/>
<entry key="process.encryptionKeyFile" value="C:\SalesforceDataLoader\key.txt"/>
<entry key="sfdc.timeoutSecs" value="600"/>
<entry key="sfdc.loadBatchSize" value="200"/>
<entry key="sfdc.entity" value="Account"/>
<entry key="process.operation" value="extract"/>
<entry key="dataAccess.name" value="C:\SalesforceDataLoader\accountInsert.csv"/>
<entry key="process.outputSuccess" value="C:\SalesforceDataLoader\accountInsert_success.csv"/>
<entry key="process.outputError" value="C:\SalesforceDataLoader\accountInsert_error.csv"/>
<entry key="dataAccess.type" value="csvWrite" />
<entry key="dataAccess.writeBatchSize" value="1" />
<entry key="sfdc.extractionRequestSize" value="1" />
<entry key="process.enableExtractSuccessOutput" value="true" />
<entry key="process.initialLastRunDate" value="2005-12-01T00:00:00.000-0800"/>
<entry key="dataAccess.name" value="C:\SalesforceDataLoader\Exported_Accounts.csv" />
<entry key="sfdc.extractionSOQL" value="select id, Name, Industry, Phone from account" />
</map>
</property>
</bean>
NagendraNagendra (Salesforce Developers) 
Hi Sanket,

Sorry for this issue you are encountering.

May I suggest you please check with below link from the stack exchange community with a similar discussion which might help you further with the above issue. Hope this helps.

Kindly mark this as solved if the reply was helpful.

Thanks,
Nagendra