This article presents an approach to extracting picklists of objects from 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.
Make a note of your Consumer Key and Consumer Secret. These will be needed in the next step.
Start Talend Studio and create an Integration Job.
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.
Run a test to retrieve the token (access_token).
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:
At this step, the partial Job looks like this:
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.
Run a test to see the response body.
The next step is to add a filter to save only picklist types. In this example, tXMLMap was used:
At this stage, the complete operational Job looks like this:
The sample output (from the tLogRow_1 component) is pasted below for reference, along with a corresponding screenshot from Salesforce for this field: