Connecting Pieces: How to Put it All Together
version: 2020.2.27
When creating new iiidea via the Riiiver App (Android/iOS), the user is asked to select the 3 Pieces that will make up this iiidea. Riiiver emphasizes user choice, and creators can choose to start with any of the T, S, or A Pieces, but it is important to recognize that each Piece has its own input/output type that determines what other Pieces to which it can connect.
For instance, if a user starts with the middle S Piece, then they will only be able to connect to T Pieces that output the type of data that this S Piece wants input, and they will only be able to connect to A Pieces that want the input that this particular S Piece outputs. It's all about connecting outputs and inputs that match, and it's a lot simpler than it sounds.

In the above image, you can see that we've selected an S that wants no particular input (None), but outputs a Number as its result. If a user were to select this Piece first, the following restrictions would apply:

A user starting with this S Piece will be able to connect to any T Piece (as no particular input type is specified), but they will only be able to see A Pieces that can receive a Number input. The user will NOT see A Pieces that are expecting other inputs, such as String data. Pieces must connect according to the input/output rules, and the details of those rules are described on this page.
Input/Output Rules
Does this Piece require a specific input/output?
Piece connections depend entirely on matching inputs/outputs, but what about Pieces that don't specify any definite input/output?
Pieces that don't require a specific input (
None) can actually connect to any previous Piece. However, this Piece will simply ignore and throw out any data that is input to it before executing its own function.
Pieces with no particular output cannot connect to following Pieces that are awaiting a specific type of input. But if the next Piece is also satisfied with a null input, then outputting nothing works just fine.

In all other cases, the input/output types need to match, with detailed connection rules as follows:
Rules for Connecting Pieces with Active Input/Output
There are 5 types of information that Pieces can be defined to accept as input or distribute as output:
| Type | Additional restrictions? |
|---|---|
| boolean | No |
| string | Yes |
| number | Yes |
| object | Yes |
| array | Yes |
The first rule of connecting Pieces is simply to plug together matching inputs and outputs (outside of the unique Noneoptions described above). Furthermore, 4 of the 5 types actually have additional conditions that need to be met for a clean match.
Those additional conditions are detailed below, with PieceJSON examples to demonstrate the execution:
boolean
Additional restrictions
None.
PieceJSON Example
"output" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "boolean",
"x-title" : {
"en" : "Output whether it succeeds.",
"ja" : "正常に終了したかどうか出力"
}
}
}
},Input/Output Example
{
"result": true
}string
Additional restrictions
- The
stringinput and output formats need to match as well. Refer to the below Format Table when designing your Piece. - If the
stringformats don't match, then it doesn't matter if both Pieces are expectingstringinput/output, because they will not be able to connect. The only exception to this is... - When a Piece is expecting a
stringformatted astext, it can can accept as input any kind ofstringoutput by the previous Piece.
Format Table
| Type | Format | Example | Notes |
|---|---|---|---|
| string | text | - | Can accept any string input without limitation |
| - | Format in accordance with email standards: RFC 5322, section 3.4.1 | ||
| date-time | 2019-06-13T20:20:39+09:00 | Format as: YYYY-MM-DDThh:mm:ssTZD | |
| date | 1997-07-16 | Format as: YYYY-MM-DD | |
| time | 20:21:10 | Format as: hh:mm:ss |
PieceJSON Example (date-time)
"output" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "string",
"format" : "date-time",
"x-title" : {
"en" : "Current time(YYYY-MM-DDThh:mm:ssTSD)",
"ja" : "現在日時(YYYY-MM-DDThh:mm:ssTSD)で出力"
}
}
}
},Input/Output Example (date-time)
{
"result": "2019-06-13T20:20:39+09:00"
}number
Additional restrictions
Number type input/output requires that you set a mininum (min) and maximum (max) value. Please only set these min/max values between -1,000,000 and 1,000,000
- When the input
minvalue is lower than or equal to the outputminvalue, the Pieces can connect. (For instance: If the input Piece requires a minimum value of 10, and the output Piece only delivers numbers higher than 10, these two Pieces are OK to connect.) - When the input
maxvalue is higher than or equal to the outputmaxvalue, the Pieces can connect. (For instance: If the input Piece only accepts a maximum value of 100, and the output Piece delivers valus up to 1000, these two Pieces are OK to connect. However, in this case only the maximum input value of 100 will be processed.)

In other words, if the total range of output possibilities of a Piece fits completely within the total range of input possibilities expected by the subsequent Piece, then we know that the number can be sent and delivered successfully, and the Pieces can be connected.
PieceJSON Example
"output" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "number",
"x-title" : {
"en" : "Age.",
"ja" : "年齢を出力"
},
"min" : "0",
"max" : "120"
}
}
},Input/Output Example
{
"result": 30
}object
Additional restrictions
The
objecttype input/output allows you to include a number of different types of information in a single Piece; however, the number of objects output by one Piece must match the number of objects expected as input by the next Piece. In the below example, you can see a Piece that outputs 4 uniqueobjectdata (number- direction,number- distance,string, andboolean).
Just as you need to match the same number of
objectdata, you also need to match the names given to each of these objects, so that the Pieces know which outputobjectconnects to which inputobject. In the below example, the titles given to the 4objectdata are:direction、distance、storeName、andopenHour. Therefore, the next Piece needs to be ready to accept 4 objects with those exact titles.
All settings and types for the paired input/output
objectdata also need to match. Please similarly be sure that the white space and order of the values is the same between the input and outputobjectPieces to facilitate a smooth and snug connection.If including any of the
boolean,string, ornumbertypes described on this page above, the rules for each of those individual types need to be met. For example, including anumberoutput in a Piece that also delivers other object data doesn't invalidate the value limits that exist in Pieces that only delivernumberdata.
PieceJSON Example
"output" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "object",
"properties" : {
"direction" : {
"type" : "number",
"x-unit" : "degrees",
"x-title" : {
"en" : "Direction to the store.",
"ja" : "お店の方向"
},
"min" : "0",
"max" : "359"
},
"distance" : {
"type" : "number",
"x-unit" : "m",
"x-title" : {
"en" : "Distance to the store.",
"ja" : "お店までの距離"
},
"min" : "0",
"max" : "5000"
},
"storeName" : {
"type" : "string",
"format" : "text",
"x-title" : {
"en" : "Store name.",
"ja" : "店名"
}
},
"openHour" : {
"type" : "boolean",
"x-title" : {
"en" : "Output true/false whether the store is open.",
"ja" : "開店しているかどうか"
}
}
}
}
}
},Input/Output Example
"result": {
"direction": 350,
"distance": 1200,
"storeName": "Starbucks",
"openHour": true
}array
Additional restrictions
In the above we've discussed the basics and rules for connecting Pieces that are of the same type (boolean、string、number、object). However, these are all one-to-one connections. With an array type Piece, you can include multiple items of the same type in a single input/output.

Additionally, you can set the mininum (minItems) and maximum (maxItems) amount of items that the Piece can input/output, such that a random amount of items within this range will be input/output. If you do not set these minimums of maximums, then theminItemsvalue will be set tominItems = 0, and themaxItemsvalue will be set tomaxItems = 2,147,483,647. This default setting will deliver all items included in the array to the next Piece.When the input amount of
minItemsin a receiving Piece is lower than or equal to the output amount ofminItemsdelivered by the previous Piece, connection is possible. (For instance: If the input Piece requires at least 2 input items, and the output Piece delivers 3, these two Pieces are OK to connect. However, only the first 2 outputs will be received.)Similarly, when the input number of
maxItemsin a receiving Piece is lower than or equal to the output amount ofmaxItemsdelivered by the previous Piece, connection is possible.
PieceJSON Example (String-type items)
"output" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "array",
"x-title" : {
"en" : "Output the current time in 1, 2, or 3 different regions.",
"ja" : "1~3つの地域の時刻を出力"
},
"maxItems":3,
"minItems":1,
"items":{
"type": "string",
"format": "time"
}
}
}
},Input/Output Example (String-type items)
"result" : {
["10:01:01", "10:05:01", "09:01:01"]
}
PieceJSON Example (Object-type items)
"output" : {
"type" : "object",
"properties" : {
"result" : {
"type" : "array",
"x-title" : {
"en" : "Output all store detail information.",
"ja" : "お店の方向、距離、店名、開店しているかどうかの中から必要な項目を出力"
},
"maxItems":3,
"minItems":1,
"items":{
"type" : "object",
"properties" : {
"direction" : {
"type" : "number",
"x-unit" : "degrees",
"min" : "0",
"max" : "359"
},
"distance" : {
"type" : "number",
"x-unit" : "m",
"min" : "0",
"max" : "5000"
},
"storeName" : {
"type" : "string",
"format" : "text"
},
"openHour" : {
"type" : "boolean"
}
}
}
}
}
},Input/Output Example (Object-type items)
"result" : {
[
{ "direction": 350, "distance": 1200, "storeName": "Starbucks", "openHour": true},
{ "direction": 10, "distance": 2500, "storeName": "Cafe", "openHour": false}
]
}