DataTable commands

Managing DataTables from the mabl CLI

In the mabl CLI, you can programmatically list, query, create, update, and export DataTables from your workspace.

mabl datatables list

The mabl datatables list command returns a list of DataTable IDs, names, and the date they were created.

Options

OptionDetails
--limit, -lThe number of DataTables to return. The default is 10.
--output, -oSpecify the output format. The default is a table. Choices: "yaml, "json".

Examples

# List 20 DataTables in the workspace
$ mabl datatables list --limit 20 

# List DataTables in yaml format
$ mabl datatables list --output yaml

# List five DataTables in json format
$ mabl datatables list --limit 5 --output json

mabl datatables describe

The mabl datatables describe command returns details on the specific DataTable, including workspace ID, name of the DataTable, scenario IDs, time created and by whom, time last updated and by whom.

mabl datatables describe <datatable-id>

Options

OptionDetails
--output, -oSpecify the output format. The default is yaml. Choices: "json", "yaml".

Examples

# Describe DataTable in JSON format
$ mabl datatables describe <datatable-id> --format json

mabl datatables scenarios

The mabl datatables scenarios command lists the scenario ID, scenario name, and created time of each scenario in a DataTable.

Options

OptionDetails
--limit, -lSpecify the number of scenarios to return. The default is 10.
--output, -oSpecific the output format. Choices: "json", "yaml".

Examples

# List DataTable scenarios
mabl datatables scenarios <datatable-id>

# List DataTable scenarios in JSON format
mabl datatables scenarios <datatable-id>

mabl datatables create

Use mabl datatables create to create a DataTable from a JSON or CSV file. The file input should be a relative path to the file you are using to create the DataTable.

On creating the DataTable, the mabl CLI returns details on the new DataTable, including workspace ID, name of DataTable, scenario IDs, time created and by whom, time last updated and by whom.

Options

OptionDetails
--name, --table-nameThe name of your new DataTable. If no name is provided, the DataTable name is the name of the file.
--format, --fmtIf the file input is missing the file extension, specify the format of your input file: "json" or "csv".

File input

JSON format

[
    {
      "name": "English",
      "variables": [
        {
          "name": "login",
          "value": "Login"
        },
        {
          "name": "greeting",
          "value": "Welcome back"
        },
        {
          "name": "logout",
          "value": "Logout"
        }
      ]
    },
    {
      "name": "Spanish",
      "variables": [
        {
          "name": "login",
          "value": "Iniciar sesión"
        },
        {
          "name": "greeting",
          "value": "Qué bueno verte de nuevo"
        },
        {
          "name": "logout",
          "value": "Cerrar sesión"
        }
      ]
    }
  ]

CSV

Scenario name, login, greeting, logout
English, Login, Welcome back, Logout
Spanish, Iniciar sesión, Qué bueno verte de nuevo, Cerrar sesión

Examples

# Create a DataTable from a JSON file
$ mabl datatables create login_check.json --name "Login check"

# Create a DataTable from a CSV file and name it "Sample data"
$ mabl datatables create samples.csv --name "Sample data"

mabl datatables update

Use mabl datatables update to update a mabl DataTable with a JSON or CSV file. The file input should be a relative path to the file you are using to update the DataTable. When you run the command, the mabl CLI outputs the name of the exported file, which contains the DataTable scenarios and scenario values.

Options

OptionDetails
--format, --fmtIf the file input is missing the file extension, specify the format of your input file: "json" or "csv".

Examples

# Update a DataTable from a JSON file called test.json
$ mabl datatables update <datatable-id> test.json

# Update a DataTable from a CSV file called test.csv
$ mabl datatables update <datatable-id> test.csv

mabl datatables export

The mabl datatables export command outputs a mabl DataTable in a specific format: yaml, JSON, or CSV.

Options

OptionDetails
--format, --fmtSpecify the format for the datatable export: "yaml", "json", or "csv"

Examples

# Export a DataTable in json format
$ mabl datatables export <datatable-id> --format json

# Export a DataTable in csv format
$ mabl datatables export <datatable-id> --format csv