BLOCKS Reference

Block Reference

Basic

Construct Object

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. Values can be set among the following seven types:

  • String: Designate the data as a string. You can also use 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)
  • Array: Designate the data as an array. You will be able to set multiple values that make up the array. (2)

The following JSON format results are 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"
  ]
}

If you want to use array data, decide its key (for example, “ary”) and the variable that will store it (for example, var). When referencing this array from another BLOCK, specify it with something like var.ary

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 that will make up the constructed object as key-value pairs. Values can be set among the following seven types:

  • String: Designate the data as a string. You can also use 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.
  • Array: Designate the data as an array. You set multiple values that make up the array.
BLOCK memos Make notes about this BLOCK.