Data Tables
Data tables allow you to store data locally and ensure that Architect can access the data within an interaction.
Important: Data tables are intended for the use of configuration data. Data tables are not intended to contain personal information. Do not submit any information that could be used to identify a natural living person, or any other sensitive or confidential information.
For more information about data tables, see Work with data tables in the Genesys Cloud Resource Center.
Work with Data Tables
When you use the endpoint GET /api/v2/flows/datatables/{datatableId}
to get a data table, the table id, name, and division are returned by default. To view schema information for the table, schema
must be in the expand
query parameter. Unlike some endpoints, expanding the schema doesn't incur additional network calls that might affect rate limiting.
You can use the following request body to create a data table:
{
"name": "Sample Table",
"schema": {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"key"
],
"properties": {
"key": {
"title": "key",
"type": "string",
"$id": "/properties/key"
},
"myStr": {
"title": "myStr",
"type": "string",
"$id": "/properties/myStr"
},
"myInt": {
"title": "myInt",
"type": "integer",
"$id": "/properties/myInt"
},
"myBool": {
"title": "myBool",
"type": "boolean",
"$id": "/properties/myBool"
},
"myDecimal": {
"title": "myDecimal",
"type": "number",
"$id": "/properties/myDecimal"
}
},
"additionalProperties": false
}
}
The additionalProperties
property must be set to false
. The key field must be the only value in the required list of the schema. To give a field a different label, update the title property in the schema.
Work with Rows
Use Pro mode within the API Explorer to populate the request body when you add rows (POST /api/v2/flows/datatables/{datatableId}/rows
) or update an existing row (PUT /api/v2/flows/datatables/{datatableId}/rows/{rowId}
). The request schema for a data table row is validated against the JSON schema defined for the table. There is not a generic model that can be generated for the two previously mentioned endpoints and be used within the API Explorer.
Based on the schema from the previous example, you can use the following request body to create a row:
{
"key": "foo",
"myStr": "bar",
"myInt": 90125,
"myBool": true,
"myDecimal": 21.12
}
The endpoint for updating a data table row (PUT /api/v2/flows/datatables/{datatableId}/rows/{rowId}
) expects the key field in both the request path and body.
You must use the API Field ID for creating or updating rows. This value does not change if a field has a new label. Use this value also when you import rows using a .csv file.