BLOCKS Reference

Box

Load to variable from Box

Overview

This BLOCK is currently in beta and will become unavailable post official release. Please use the official version once released.

As a beta release, there is the possibility that some functions may not execute properly. We appreciate feedback from users regarding bugs or ways to improve BLOCKS.

This BLOCK reads a file stored in Box and loads its contents into a variable. You can use data from this BLOCK to make predictions with a Model Generator, upload data to BigQuery, and the like.

You can load the contents of files directly as they are from Box, or set the File format property to convert them into the formats required by other BLOCKS.

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

Stores the contents of the file into the variable as a Base64 encoded string.

Select this file format when using the Model Generator prediction (online) BLOCK for image classification.

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

Parses the contents of the file as CSV format, converts them into an object, and stores the object into the variable. Handles all fields in the CSV as strings when converting 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.
Box service account

Select the Box service account to use with this BLOCK.

You must register a Box service account within the Box service accounts section of the Flow Designer Settings menu beforehand.

User ID

Designate the User ID of the Box service account.

If the Application Access of your Box service account (Box app) is set to Application, do not enter anything into this property.

To view your Box service account’s User ID, access the Box Developer Console, select your Box app, and find it within the General information’s App Info section.

Box Developer Console User ID

*Click to enlarge.

Source file path

Designate the path for the file in Box. The formatting is as follows:

  • /FILE
  • /FOLDER/FILE

The initial / points to the “All Files” page. The / between the folder and file names is to distinguish them.

/FILE: Use this format is the source file is stored directly in the “All Files” page in Box. For example, if the file sample.png was stored directly in the “All Files” page, you would enter /sample.png into this property.

/FOLDER/FILE: Use this format if the source file is stored within a folder in Box. For example, if a folder named BLOCKS was in the “All Files” page, and this folder contained the file sample.png, you would enter /BLOCKS/sample.png into this property.

If the source file is within nested folders, use the format /FOLDER 1/FOLDER 2/FILE.
For example, if folder A contains folder B, which contains the file sample.png, you would enter /A/B/sample.png into this property.

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

Select the format of the Box file from the following: (none), Binary (Base64), JSON, 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.

この情報は役に立ちましたか?