Array Sub-table is a field type that allows you to create an Array of JSON Objects visually in the form of a Sub-table. The column names of the Sub-table become the keys of the JSON Object and the row values become the values of the JSON Object.
Creating an Array Sub-table
STEP 1: In your Rowy Table, click on Add Column button.
STEP 2: In the Add Column modal, enter a name for your column and select Array Sub-table as the field type.
STEP 3: Click on Next and select a Parent Label for your Array Sub-table. Click Update.
STEP 4: Add a row to your table, and click on the Open Table button next to the Array Sub-table field.
STEP 5: Click on the open table icon, this opens the Array Sub-table. In the Array Sub-table, add columns for the JSON object keys, and rows for the JSON object values.
Supported Field types for Array Sub-table
Since the Array Sub-table field is a visual representation of an array of JSON objects, it currently does not support the following field types:
- Array Sub-table (Nested)
- Audit Fields
Example - Stationary Store Inventory
Suppose you want to keep track of the inventory for different stationary shops along with their basic information such as Address and Contact Information. You can use an Array Sub-table field to store the products for each shop, along with their quantity and whether or not they are sold.
Suppose you have two shops, Shop A and Shop B, and you want to track the inventory for them.
SHOP - A INVENTORY
SHOP - B INVENTORY
You can store the data for each shop in seperate rows, each having a Shop Name, Address Field, Contact Number Field, and an Array Sub-table Field to store the inventory. The Array Sub-table field will store the data in the form of an array of JSON objects.
The table would look something like this:
Array Sub-table storage in Firestore
When using the Array Sub-table field type in your Rowy Table, the data is stored in Firebase Firestore as an array of JSON objects.
Each row in the Array Sub-table corresponds to a single JSON object, with the column names of the sub-table becoming the keys of the JSON object and the row values becoming the values of the JSON object.
The data for each of your rows is stored as follows in your Firestore database:
Viewing the JSON Data of an Array Sub-table
If you want to see how the data for your Array Sub-table is stored in JSON format, you can follow these steps:
- Click on the Column Menu of the Array Sub-table field and open the Edit Type menu.
- In the modal, select the JSON field type from the dropdown menu. Click Update.
Once you've changed the field type to JSON, you will be able to view the JSON object for each row in the Array Sub-table.