BLOCKS Reference

G Suite

Load to variable from Google Drive

Overview

This BLOCK reads a file stored in Google Drive and loads its contents into a variable. With this BLOCK, you can use data from a file in Google Drive for making predictions with a Model Generator, storing data into BigQuery, and more.

You can load data from a file in Google Drive as is, or configure the File format property to convert the data into a format that you can use with other BLOCKS.

File format Explanation
(none) Loads the contents of the file into the variable without any conversion.
Binary (Base64)

Converts the data with Base64 encoding and stores the results into the variable.

Select this file format if you will perform image classification predictions with the Model Generator prediction (online) BLOCK.

JSON Parses the contents of the file as JSON, converts it into an object, and stores it into the variable.
CSV

Parses the contents of the file a CSV format, converts it into an object, and stores it into the variable. It handles all fields in the CSV file as strings when converting it into the object.

When using the CSV format, it is assumed that there is a header row, like the one shown below. The header row contains the same number of items as the other rows, and its fields are a list of the field names.

field_name_1,field_name_2,field_name_3
aaa,bbb,ccc
xxx,yyy,zzz

Reading from CSV format data as shown above would load the following object into the variable:

[
  {
    "field_name_1": "aaa",
    "field_name_2": "bbb",
    "field_name_3": "ccc"
  },
  {
    "field_name_1": "xxx",
    "field_name_2": "yyy",
    "field_name_3": "zzz"
  }
]

When using the Model Generator prediction (online) BLOCK for regression or classification predictions, prepare a header row with the field for keys named key and each other field named for the various input features.

key,sepal_legth,sepal_width,petal_length,petal_width
1,5.9,3.0,4.2,1.5
2,6.9,3.1,5.4,2.1
3,5.1,3.3,1.7,0.5

All numbers will be converted into strings, but this is not a problem because the Model Generator prediction (online) BLOCK can accept numbers as strings.

Properties

Property Explanation
BLOCK name Configure the name displayed on this BLOCK.
GCP service account

Select the GCP service account to use with this BLOCK.

Source file

Designate the name of the file whose contents will be stored into the destination variable.

You can also enter the URL of the file into this property. This can either be the sharing link or the URL from the address bar of your web browser.

Destination variable Designate the variable that will store the contents of the source file.
File format

Select the format of the source file as (none), Binary (Base64), JSON, or CSV.

BLOCK memos Make notes about this BLOCK.
CSV delimiter character

When the File format property is set to CSV, select the delimiter character used in the CSV file from the following: Comma (,), Tab, Pipe (|), Other.

If you select Other, enter the delimiter character used into the field next to Other.

Number of skipped rows When the File format property is set to CSV, configure the number of lead rows from the top to skip, if desired.
Designate quotation marks When the File format property is set to CSV, designate the character used for quotation marks surrounding fields.