$caila.setClientEntityRecords
Overwrites all the records of an entity for a certain client.
Syntax
The arguments accepted by the method are the name of the entity where the records are to be updated and parameters of the updated records.
- ECMAScript 5
- ECMAScript 6
$caila.setClientEntityRecords("EntityName", {"type": "synonyms", "rule": [$parseTree.text], "value": $parseTree.text});
In the ECMAScript 6 runtime, the method is asynchronous:
await $caila.setClientEntityRecords("EntityName", {"type": "synonyms", "rule": [$parseTree.text], "value": $parseTree.text});
Parameter | Type | Mandatory | Description |
---|---|---|---|
EntityName | string | Yes | Name of the entity where the record is to be added. |
type | string | Yes | The method used to specify the record value. Takes the following values: synonyms or pattern . |
value | sring | Yes | The value associated with the record. Corresponds to the DATA field. |
rule | array<string> | Yes | The set of rules describing the values that will be added as a record. For example: $parseTree._<SlotName> . |
clientId | string | No | Client ID. |
classifierToken | string | No | API key used to access an external trained classifier. |
How to use
Update current records of an entity:
- ECMAScript 5
- ECMAScript 6
state: prepare
q!: prepare
script:
$caila.setClientEntityRecords("ClientEntity", [
{"type": "synonyms", "rule": ["one"], "value": "1"},
{"type": "synonyms", "rule": ["two"], "value": "2"},
{"type": "synonyms", "rule": ["three"], "value": "3"},
{"type": "synonyms", "rule": ["four"], "value": "4"},
{"type": "synonyms", "rule": ["five"], "value": "5"}
]);
state: prepare
q!: prepare
scriptEs6:
await $caila.setClientEntityRecords("ClientEntity", [
{"type": "synonyms", "rule": ["one"], "value": "1"},
{"type": "synonyms", "rule": ["two"], "value": "2"},
{"type": "synonyms", "rule": ["three"], "value": "3"},
{"type": "synonyms", "rule": ["four"], "value": "4"},
{"type": "synonyms", "rule": ["five"], "value": "5"}
]);