Scenario: Data transmission between Marketo DB and an external system - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

The following scenario describes a five-component Job that inserts Lead records into Marketo database and retrieves these records from Marketo database to a local file. Upon completing the data accessing, the Job displays the number of relevant API calls on the Run console.

Setting up the Job

  1. Drop tMarketoOutput, tMarketoInput, tFileInputDelimited, tFileOutputDelimited and tJava from the Palette onto the design workspace.

  2. Connect tFileInputDelimited to tMarketoOutput using a Row > Main connection.

  3. Connect tMarketoInput to tFileOutputDelimited using a Row > Main connection.

  4. Connect tFileInputDelimited to tMarketoInput using a Trigger > OnSubjectOk connection.

  5. Connect tMarketoInput to tJava using a Trigger > OnSubjectOk connection.

Configuring tFileInputDelimited

  1. Double-click tFileInputDelimited to define the component properties in its Basic settings view.

  2. Click the [...] button next to the File name/Stream field to select the source file for data insertion. In this example, it is D:/SendData.csv.

  3. Click the [...] button next to Edit schema to set the schema manually.

  4. Click the [+] button to add four columns: Id, Email, ForeignSysPersonId and ForeignSysType. Set the Type of Id to Integer and keep the rest as default. Then click OK to save the settings.

  5. Type in 1 in the Header field and keep the other settings as default.

Configuring tMarketoOutput

  1. Double-click tMarketoOutput to define the component properties in its Basic settings view.

  2. Click the Sync columns button to retrieve the schema defined in tFileInputDelimited and fill the Endpoint address field with the URL of the Marketo Web server. In this example, it is https://na-c.marketo.com/soap/demo/demo1.

    Note that the URL used in this scenario is for demonstration purposes only.

  3. Fill the Secret key field with encrypted authentication code assigned by Marketo. In this example, it is 1234567894DEMOONLY987654321.

  4. Fill the Client Access ID field with the user ID. In this example, it is mktodemo1_1234567894DEMOONLY987654321.

  5. Select syncMultipleLeads from the Operation list and type in the limit of query timeout in the Timeout field. In this example, use the default number: 600000.

Configuring tMarketoInput

  1. Double-click tMarketoInput to define the component properties in its Basic settings view.

  2. From the Operation list, select getLead.

  3. In Columns Mapping area, type in test@talend.com in Columns in Marketo column to set the Email column.

    Note that all the data used in this scenario is for demonstration purposes only.

  4. From the LeadKey type list, select EMAIL and fill the LeadKey value field with test@talend.com.

  5. Keep the rest of the settings as the corresponding settings in tMarketoOutput.

Configuring tFileOutputDelimited

  1. Double-click tFileOutputDelimited to define the component properties in its Basic settings view.

  2. Click the [...] button next to the File name field to synchronize data to a local file. In this example, it is D:/ReceiveData.csv.

  3. Click the Sync columns button and keep the rest of the settings as default.

Using Java scripts to count API calls

  1. Double-click tJava to add code in its Basic settings view.

  2. In the Code field, type in following code to count the number of API calls throughout the data operations:

    System.out.println(("The Number of API calls for inserting
    data to Marketo DB is:"));
    System.out.println((Integer)globalMap.get("tMarketoOutput_1_NB_CALL"));
    System.out.println(("The Number of API calls for data synchronization
    from Marketo DB is:"));
    System.out.println((Integer)globalMap.get("tMarketoInput_1_NB_CALL"));

Job execution

  1. Save your Job.

  2. Press F6 to execute it.

    The inserted lead records in the Marketo DB are synchronized to D:/ReceiveData.csv.

    The number of API calls throughout each data operation is displayed on the Run console.