+ Start a Discussion
Charles BonsallCharles Bonsall 

Using Format() with Data Loader Command Line


I am attempting to extract information from a salesforce object using the data loader command line functionality.  I currently have a process-conf and .sdl that execute properly.  However, when I attempt to include Format() in the select statement, I am unsure of how to modify the mapping in the .sdl to bring it into the .csv.  I've tried a couple things that were unsuccessful.

This example works fine:
Select Id, CreatedDate
From Account

This example does not:
Select Id, format(CreatedDate)
From Account
John TowersJohn Towers
What does your .sdl look like?

I think the problem is that using 'format(CreatedDate)' changes the name of the column being returned to 'format(CreatedDate)'. So if your .sdl is just using 'CreatedDate' it won't pick it up. If you  haven't already  you might try changing your .sdl mapping to 'format(CreatedDate)' and see if that works.
Charles BonsallCharles Bonsall
Hi John,

I agree with that.  However, when I've attempted to put that in the .sdl, I get the following error when running process.bat "java.lang.RuntimeException: java.lang.NullPointerException"

I tried writing FORMAT(CREATEDDATE) which is the field header when using the Data Loader GUI (it works in there).  I also tried using format(CreatedDate) as it's written in the SOQL query.  Both unfortunately return the same error.

My next thought was to alias the function as the official documentation suggests that Format() is a field that recognizes an alias.  However, the alias is ignored through the GUI and the command line returns an error stating that the alias name is not found on the object.
Jgk kJgk k
Hello Charles,
Did you find any solution for this? I have a same requirement to alter date format to mm/dd/yyyy when data is exported via Commandline Dataloader from salesforce. Currently the default format for date fields is yyyy-mm-dd.