Creation
Create Data Table would open New Table page where you have to enter the following details:
- Name of the Data Table;
- Description of the Data Table;
- Columns to be included in the Table;
- Indexes for the Table;
- Bot Assignment for accessing the data in this table;
- App Assignment for accessing the data in this table.
Columns
The second step in defining a Data Table would be to add columns that make up the table. Column definition includes:
- Name of the column (see here for reserve words which cannot be used as the name of a column);
- Type of the data that can be stored in this column. It can be:
- string;
- date; or
- number.
- Required flag to mark the column as mandatory.
- Encrypted flag to secure the data in this column.
- Reference Column to create a dependency with a column from another table ie to add a foreign key constraint. This would ensure that the value entered for this column exists in the referenced table column.
- Max Length to limit the maximum length for the column values.
- Default Values to be taken in case the value is missing while adding a row.
By default the following columns would be defined by the platform:
- sys_Id: A platform generated unique identifier for each row in the table.
- Created_On: Timestamp when this table was created;
- Updated_On: Timestamp when this table was updated;
- Created_By: User id of the developer who created this table;
- Updated_By: User id of the developer who last updated this table.
Index
For an improved performance during Data search and retrieval, you can define Indices for your Data Table.
This includes:
- Index Name for reference;
- Is Unique flag to define if the index is expected to contain unique values;
- Column & Sort Order – List of columns to be included in the index; you can select multiple columns and specify the sort order (ascending or descending) for each of the selected columns.
Assignments
You can define the assignments for each of the data tables as follows:
- Assign bots:
- Assign bots with Read, Write, and Delete permissions. You can select the bots from the list presented, these will be the list of bots owned by you and shared with you.
- Only the assigned bots will be allowed to access the data from the data table using the Service Nodes in the Dialog Tasks of that bot.
- Assign apps:
- Assign apps with Read, Write, and Delete permissions.
- You can select from the list or create a new app.
- The data table CRUD APIs will be restricted to access only the tables that are assigned to the app.
- Assign process apps:
- Assign process apps with Read, Write, and Delete permissions. You can select the process apps from the list presented, these will be the list of process apps owned by you and shared with you.
Import & Export
Data Table definition can be exported and imported as JSON format files.
To Export:
- Hover over the table definition that you want to Export
- Click the more (ellipses) icon and select Export Definition
- JSON file would be generated and downloaded.
To Import:
- Click the down arrow next to the New Table button.
- Select the Import Table Definition option.
- Enter a Table Name and select the JSON file containing the table definition.
- Click Import.
Sample Data Definition JSON file
{"name":"customertable", "description":"Table containing customer details", "indexes":[], "schemaDef":[{"name":"CustEmail", "type":"string", "isRequired":false, "isEncrypted":false, "reference":{}, "maxLength":"", "default":""}, {"name":"CustType", "type":"string", "isRequired":false, "isEncrypted":false, "reference":{}, "maxLength":"", "default":"Preferred"}, {"name":"Address", "type":"string", "isRequired":false, "isEncrypted":false, "reference":{}, "maxLength":"", "default":""}, {"name":"CustName", "type":"string", "isRequired":true, "isEncrypted":false, "reference":{}, "maxLength":"", "default":""}, {"name":"CustId", "type":"number", "isRequired":true, "isEncrypted":true, "reference":{}, "maxLength":"5", "default":""}, {"name":"sys_Id","type":"string","isRequired":true,"readOnly":true}, {"name":"Created_On","type":"date","isRequired":true,"readOnly":true}, {"name":"Updated_On","type":"date","isRequired":true,"readOnly":true}, {"name":"Created_By","type":"string","isRequired":true,"readOnly":true}, {"name":"Updated_By","type":"string","isRequired":true,"readOnly":true}]}
Reserve Words
Following is the list of words that are reserved and cannot be used as the names for a column:
- ACCESS
- ADD
- ALL
- ALTER
- AND
- ANY
- AS
- ASC
- AUDIT
- BETWEEN
- BY
- CHAR\
- CHECK
- CLUSTER
- COLUMN
- COMMENT
- COMPRESS
- CONNECT
- CREATE
- CURRENT
- DATE
- DECIMAL
- DEFAULT
- DELETE
- DESC
- DISTINCT
- DROP
- ELSE
- EXCLUSIVE
- EXISTS
- FILE
- FLOAT
- FOR
- FROM
- GRANT
- GROUP
- HAVING
- IDENTIFIED
- IMMEDIATE
- IN
- INCREMENT
- INDEX
- INITIAL
- INSERT
- INTEGER
- INTERSECT
- INTO
- IS
- LEVEL
- LIKE
- LOCK
- LONG
- MAXEXTENTS
- MINUS
- MLSLABEL
- MODE
- MODIFY
- NOAUDIT
- NOCOMPRESS
- NOT
- NOWAIT
- NULL
- NUMBER
- OF
- ONLINE
- ON
- OFFLINE
- OPTION
- ON
- ORDER
- PCTFREE
- PRIOR
- PRIVILEGES
- PUBLIC
- RAW
- RENAME
- RESOURCE
- REVOKE
- ROW
- ROWID
- RONUM
- ROWS
- SELECT
- SESSION
- SET
- SHARE
- SIZE
- SMALLINT
- START
- SUCCESSFUL
- SYNONYM
- SYSDATE
- TABLE
- THEN
- TO
- TRIGGER
- UID
- UNION
- UNIQUE
- UPDATE
- USER
- VALIDATE
- VALUES
- VARCHAR
- VARCHAR2
- VIEW
- WHENEVER
- WHERE
- WITH