1. Docs
  2. Virtual Assistants
  3. Advanced Topics
  4. Data Table

Data Table

From the Data tab of the Bot Builder Landing Page, click Create Data Tables to create a data table.

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:

  1. Hover over the table definition that you want to Export
  2. Click the more (ellipses) icon and select Export Definition
  3. JSON file would be generated and downloaded.

To Import:

  1. Click the down arrow next to the New Table button.
  2. Select the Import Table Definition option.
  3. Enter a Table Name and select the JSON file containing the table definition.
  4. 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
메뉴
Kore.ai Named a Leader in 2022 Gartner® Magic Quadrant™ for Enterprise Conversational AI PlatformsGet the Report