Save frames in a base

Adding a record to a table (in a MINTDATA base) allows you to permanently save the frame data. The data is then available for collaborative reading and modification by end users in your organization.

Create a base

You can create a base using the BASE_ADD() function.

To create a base, pass a unique base-name in the function.

=BASE_ADD("base_name")
Copy to clipboard

Create a table

You can create a table in a base by using the TABLE_SPEC() function.

Before creating a table you might need to list all the tables currently available in a base. To do so, use TABLES() function, like in the example below:

=TABLES("base_name")
Copy to clipboard

The following example illustrates how to create a table:

  1. In an empty cell, enter the name of the base where you want to create a table.

  2. In an empty cell, enter a name of the table.

  3. Enter a table definition using one of the following ways:

    • Enter a definition directly in a two-column range of cells. In the first column, specify the table column names, in the respective cells in the second column, specify a data type. The following shows an example a table definition with column names "name" and an associated data type string, and "age" of type "number".
      ABC
      1namestring
      2agenumber
      3
    • Use a frame literal in the TABLE_SPEC() function. An equivalent frame literal for the table definition above is {"name","string";"age", "number"}. You can either pass the frame literal directly in the function, or create a frame by entering '={"name","string";"age", "number"}' in an empty cell, and then reference the cell in the TABLE_SPEC function.
  4. In an empty cell, enter a formula that contains the TABLE_SPEC() function, like in the example below:

    =TABLE_SPEC("base_name","table_name",A1:B2)
    Copy to clipboard

    As a result, the function returns a frame like this:

    Note, that when you apply the TABLE_SPEC function, an auto-generated unique ID column with 'integer' type is created by default.

Add records to a table

You can add records to a table by using the ADD_RECORDS() function.

To add records to a table:

  1. Specify data for the record by populating two rows in the spreadsheet. The first row must contain the base-table columns, and the second row must contain the respective values. The following shows an example of record data:

    ABC
    1nameage
    2bob42
    3
  2. In an empty cell, enter a formula using the TABLE_ADD_ROWS function. As the arguments, use the base name, table name, and FRAME({data-range}). The following is an example of using the TABLE_ADD_ROWS function.

    =ADD_RECORDS("base_name","table_name",FRAME(A1:B2))
    Copy to clipboard

    If the operation is successfull, TRUE is displayed in the cell which means that a new record is added to the table "table_name" in the base "base_name".

Find records in a table

You can view records that a table contains by using the GET_RECORDS()(/docs/reference/functions/get_records).

To view all records in a table, use the following formula:

=GET_RECORDS({base name}, {table_name})
Copy to clipboard

To view specific records filtered by a condition:

  1. In a range of cells, specify a condition, like in the example below:

    ABC
    1@age>25
    2@nameilikebob
    3offset1
    4count2
    5
  2. Use the address of the range above as the third argument.

    =GET_RECORDS("base_name","table_name",A1:C4)
    Copy to clipboard

Remove a base permanently

Once a base is no longer needed, you can delete it by using the BASE_DELETE() function.

The following illustrates the formula to delete a base:

=BASE_DELETE("base_name")
Copy to clipboard

To delete a base, pass the name of the base that you want to delete to the BASE_DELETE function.

The BASE_DELETE function deletes the data inside the specified base permanently. The action cannot be undone so you need to use the function with caution.

Remove a table

You can delete a table from the base by using the TABLE_DELETE() function.

To delete a table, pass to the function the name of the base as the first argument, and, as the second argument, pass the name of the table to delete.

The following shows an example of formula that deletes the table "table_name" from the base "base_name":

=TABLE_DELETE("base_name","table_name")
Copy to clipboard

Try it now

Contents