Data Table¶
You can create a data table and share it with virtual assistants, apps and process assistants.
Step to create a new table:
-
Go to the Data tab in the Home page and select the Data Tables option and click Create Data Table.
-
In the New Table page, 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 Assignments to let virtual assistants access data in this table.
- App Assignments to let apps access data in this table.
- Process Assignments to let a process app access data in this table.
-
Click Create.
Columns¶
The second step in defining a Data Table is to add columns required in the table.
- 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 i.e. 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 platform defines the following columns:
- 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¶
You can export and import Data Table definitions as JSON format files.
Export a Data Table¶
Steps:
- Hover over the table definition that you want to Export
- Click the more (ellipses) icon and select Export Definition
- A JSON file is generated and downloaded.
Import a Data Table¶
Steps:
- 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 in the 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}]}
Change Table Owner¶
The table owner can transfer the ownership to another user to let them manage the table’s definition and app assignments. An account administrator can also change the table owner.
Steps to change the table owner:
- Hover over the data table for which you want to change owner.
-
Click the more (ellipses) icon and select Change Owner option.
-
In the Change Table Owner dialog, select the new owner from the list and click Proceed.
-
Review the related tables associated with this table which may have changes in ownership.
- Once the ownership changes, a successful completion message will appear.
-
Once the Ownership is changed, all related tables and views ownership is also transferred to the new owner. The table is moved to the new owner, and all the app assignments of these tables are lost.
The Related tables and views refer to any associated table or view to a particular table based on the foreign key relations or view definitions. Following are the examples:
- View 1 is based on Table A and Table B.
- View 2 is based on Table A and Table C.
- View 3 is based on Table D.
- Table E is not used in any View.
- Table F column is referenced to a column in Table A.
-
Scenario 1: Change Owner action on Table A indicates that the ownership of Table B, Table C, Table F, View 1, and View 2 is transferred.
Scenario 2: Change Owner action on Table F indicates that the ownership of Table A, Table B, Table C, View 1, and View 2 is transferred.
Share Data Tables¶
The Kore.ai XO Platform allows you to share Data Tables by assigning them to bots, process apps, or apps.
Note: In the Shared Tables tab, you can view only the tables shared with a user who has permission to view. When you share the data tables with users, they cannot edit or update the table or view definitions.
The bot or process developers can see the data table definitions using a Service node.
- From the Data Service Request Definition, users can select the Get Data action and click Test to view metadata. For more information, read the Get Data section in Data as a Service post.
- Users can also see all column names while configuring Add Data or Update Data actions. For more information, read the Add Data section in the Data as a Service post.
Reserve Words¶
Following is the list of words that are reserved and cannot be used as the names for a column:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|