Listing files and folders in Google Drive

Google Drive

author
Talend Documentation Team
EnrichVersion
6.5
EnrichProdName
Talend Big Data
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Data Integration
Talend Open Studio for Big Data
Talend Data Fabric
Talend Big Data Platform
Talend Open Studio for Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend MDM Platform
Talend Real-Time Big Data Platform
Talend ESB
task
Data Governance > Third-party systems > Cloud storages > Google Drive components
Data Quality and Preparation > Third-party systems > Cloud storages > Google Drive components
Design and Development > Third-party systems > Cloud storages > Google Drive components
EnrichPlatform
Talend Studio

Procedure

  1. Double-click tGoogleDriveList to open its Basic settings view in the Component tab.
  2. Select the Use Existing Connection check box and from the list that appears select the component you have configured to open your Google Drive connection.
  3. In the Folder Name field, enter the name of the folder to be iterated on. In this example, it is the root directory of Google Drive and you can use the alias root to refer to it.
  4. Select Both from the FileList Type drop-down list to list both files and folders in the root directory.
    Select the Includes subdirectories check box to iterate also on the subdirectories of the root directory.
  5. Double-click tIterateToFlow to open its Basic settings view in the Component tab.
  6. Click the [...] button next to Edit schema to open the schema editor.
    Click the [+] button to add four columns: ID, Title, and MimeType of the type string, and Size of the type long.
    Click OK to validate the changes and accept the propagation prompted by the pop-up dialog box.
  7. In the Mapping table, fill in the value for each column by selecting the corresponding cell in the Value column and then press Ctrl+Space and from the list of variables that appears select the corresponding global variable of the tGoogleDriveList component. In this example:

    Column

    Value

    ID

    ((String)globalMap.get("tGoogleDriveList_1_ID"))

    Title

    ((String)globalMap.get("tGoogleDriveList_1_TITLE"))

    MimeType

    ((String)globalMap.get("tGoogleDriveList_1_MIME_TYPE"))

    Size

    ((Long)globalMap.get("tGoogleDriveList_1_SIZE"))

  8. Double-click the third tLogRow to open its Basic settings view in the Component tab.
  9. In the Mode area, select Table (print values in cells of a table) for a better display of the results.