Extracting Picklists from Salesforce


This article presents an approach to extracting picklists of objects from Salesforce.



  • Talend Studio – 6.4.1
  • Salesforce Developer Account


Set up a connected App in Salesforce

The first step is to set up a connected App in Salesforce so that a connection from Talend can be established.



The screenshot below presents a sample connected app created for this article—TestWithTalend.TestWithTalend.png


Make a note of your Consumer Key and Consumer Secret. These will be needed in the next step.


Prepare the Job in Talend

  1. Start Talend Studio and create an Integration Job.

  2. Configure a tRESTClient component to retrieve the OAuth2 token, as shown below.



    Here, client_id and client_secret are the Consumer Key and Consumer Secret captured in the last step.

    For username and password, provide your Salesforce account credentials.

  3. Run a test to retrieve the token (access_token).




  4. As the token will be required at a later stage in the Job, save it as a context variable by leveraging tExtractJSONFields and tJavaRow components as shown below:




  5. At this step, the partial Job looks like this:


  6. Now that the access_token is available, use another tRESTClient component to retrieve the picklists for the Account object. Note the URL, Authentication Type, and Bearer Token.



  7. Run a test to see the response body.



  8. The next step is to add a filter to save only picklist types. In this example, tXMLMap was used:



  9. At this stage, the complete operational Job looks like this:



  10. The sample output (from the tLogRow_1 component) is pasted below for reference, along with a corresponding screenshot from Salesforce for this field:




Version history
Revision #:
10 of 10
Last update:
‎04-04-2019 03:25 AM
Updated by:
Labels (2)
Three Stars

I have done exactly how you have shown above but i'm failing to extract the response from the body using txmlerror.jpgmap


This will not come automatically, you can copy the xml body from tLogRow(just before tXMLMap) save it to a file and import it in tXMLMap

Four Stars

Thank you so much for this. I was into this issue and tired to tinker around to check if its possible but couldnt get it done. Now that i have seen the way you did it, thanks guys

Six Stars

Hello everybody

There is a more flexible and easy to integrate method using Java routines and the Salesforce SOAP API.
You will find attached a sample code to adapt.


















To have all the values of a field, you can use this code below and write it in a file (retrieve with tFileInputDelimited for example). The idea is to integrate a loop to apply the describeGlobalSample() method and make a filter on the type of fields

On the image I work at the field level (the method takes an object name as a parameter and returns a list of values)
If you need the complete routine, don't hesitate to ask for it, I'll share it with you.