BLOCKS Reference

Basic

Construct Object

Overview

This BLOCK assembles data to into an object with structured data. It then stores the object into a variable.

The following shows an example of configuring its Data property.

Construct Object BLOCK data property example

Configure data as key and value pairs. You can set values as the following seven types:

  • String: Designate the data as a string. Supports variable expansion (${var} format variables).
  • Integer: Designate the data as an integer.
  • Float: Designate the data as a floating point number.
  • Boolean: Designate the data as a Boolean value (true or false).
  • Variable: Designate the data as a variable. The contents of the variable will be used in the object.
  • Object: Designate the data as an object. You will be able to set multiple key-value pairs that will make up the structure of the object. (1 in the image above)
  • Array: Designate the data as an array. You will be able to set multiple values that make up the array. (2 in the image above)

The following shows JSON format results from using an Output to Log BLOCK to output the object created in the previous example:

{
  "flow_name": "Confirm Construct Object Block Results (12)",
  "flow_id": 12,
  "number_of_BLOCKS": 26,
  "last_update": 1488330000.0,
  "editing": false,
  "results": {
    "status": "success",
    "start_time": 1488344400.0,
    "end_time": 1488345023.0
  },
  "logs": [
    "Finished",
    "Failed",
    "Finished"
  ]
}

For array data, designate its key (e.g., ary) and the Results variable that will store it (e.g., var). To reference this array from another BLOCK, you would specify it with var.ary.

Properties

Property Explanation
BLOCK name Configure the name displayed on this BLOCK.
Results variable Designate the variable that the object constructed from the data property will be assigned to.
Data

Designate the data for the object as key-value pairs. You can set values as the following types:

  • String: Designate the data as a string. Supports variable expansion (${var} format variables).
  • Integer: Designate the data as an integer.
  • Float: Designate the data as a floating point number.
  • Boolean: Designate the data as a Boolean value (true or false).
  • Variable: Designate the data as a variable. The contents of the variable will be used in the object.
  • Object: Designate the data as an object. You can set multiple key-value pairs that will make up the structure of this object.
  • Array: Designate the data as an array. You can set multiple values that make up this array.
BLOCK memos Make notes about this BLOCK.