Scenario: Handling data with NetSuite - 6.3

Talend Open Studio for Big Data Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Open Studio for Big Data
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

This scenario describes a Job that reads data from NetSuite, transforms the data and writes the transformed data to NetSuite, finally displays the transformed data on the console.

Adding the components

Create a new Job and add the following five components by typing their names in the design workspace or dropping them from the Palette:

  • two tNetsuiteInput components: to read data that matches the specified search criteria from the NetSuite server.

  • a tMap component: to transform the input data to the output structure.

  • a tNetsuiteOutput component: to write the transformed data into the NetSuite server.

  • a tLogRow component: to display the data received from the NetSuite server.

Configuring and linking the components

Reading, transforming, and writing data in NetSuite

  1. Double-click the first tNetsuiteInput to open its Basic settings view.

  2. In the WSDL Endpoint, Username, Password, Role, and Account fields, enter the information required to access NetSuite.

    In the Record Type list, select Location to read the location type information from NetSuite.

  3. Click the [+] button below the Search Criteria table to add one row.

    Click the cell of the Field Name column and select internalId from the drop-down list.

    Click the cell of the Operator column and select List - Any Of from the drop-down list.

    In the cell of the Value column, enter java.util.Arrays.asList("1") to retrieve only the record whose internalId is set to 1.

  4. Connect the first tNetsuiteInput to tMap using a Row > Main connection.

  5. Double-click tNetsuiteOutput to open its Basic settings view.

  6. In the NetSuite WebService URL, Username, Password, Role, and Account fields, enter the information required to access NetSuite.

    In the Action list, select insert to insert the transformed data into NetSuite.

    In the Record Type list, select Location to write the location type information into NetSuite.

  7. Click the [...] button next to Edit schema to open the schema editor. You can see the schema has already been prefilled. Keep only the columns that are relevant to your operation and delete others. In this example, keep the column Name, Parent, IncludeChildren, IsInactive, TranPrefix, Logo, MakeInventoryAvailable, MakeInventoryAvailableStore, CustomFieldList, and ExternalId.

  8. Connect tMap to tNetsuiteOutput using a Row > *New Output* (Main) connection. In the pop-up dialog box, enter the name of the output connection, out in this example. Then click Yes to let tMap get the schema of the target component tNetsuiteOutput.

  9. Double-click tMap to open its Map Editor.

    In the out output table, set the value of the Name column by entering "Paris" in the corresponding Expression column field.

    Drag and drop the Parent column in the row1 input table onto the Expression column of the corresponding row in the out output table.

    Do the same to drag and drop other columns IncludeChildren, IsInactive, TranPrefix, Logo, MakeInventoryAvailable, MakeInventoryAvailableStore, CustomFieldList, and ExternalId in the row1 input table onto the Expression column of the corresponding row in the out output table.

Retrieving the transformed data from NetSuite

  1. Double-click the second tNetsuiteInput to open its Basic settings view.

  2. In the WSDL Endpoint, Username, Password, Role, and Account fields, enter the information required to access NetSuite.

  3. In the Record Type list, select Location to read the location type information from NetSuite.

  4. Click the [+] button below the Search Criteria table to add one row.

    Click the cell of the Field Name column and select name from the drop-down list.

    Click the cell of the Operator column and select String - Contains from the drop-down list.

    In the cell of the Value column, enter Paris to retrieve only the record whose name contains Paris.

  5. Double-click tLogRow to open its Basic settings view.

  6. In the Mode area, select Vertical (each row is a key/value list) for better readability of the result.

  7. Connect the second tNetsuiteInput to tLogRow using a Row > Main connection.

  8. Connect the first tNetsuiteInput to the second tNetsuiteInput using a Trigger > OnSubjobOk connection.

Saving and executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 or click Run on the Run tab to run the Job.

    As shown above, the data has been transformed and written into NetSuite, then the transformed data is retrieved from NetSuite and displayed on the console.