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
Option | Details |
---|---|
--limit , -l |
The number of DataTables to return. The default is 10. |
--output , -o |
Specify 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
Option | Details |
---|---|
--output , -o |
Specify 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
Option | Details |
---|---|
--limit , -l |
Specify the number of scenarios to return. The default is 10. |
--output , -o |
Specific 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
Option | Details |
---|---|
--name , --table-name |
The name of your new DataTable. If no name is provided, the DataTable name is the name of the file. |
--format , --fmt |
If 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
Option | Details |
---|---|
--format , --fmt |
If 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
Option | Details |
---|---|
--format , --fmt |
Specify 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