$caila.setClientEntityRecord
Update the record of an entity for a certain client.
Syntax
The arguments accepted by the method are the name of the entity, the id
of the record and the parameters of the updated record.
- ECMAScript 5
- ECMAScript 6
$caila.setClientEntityRecord("EntityName", {"id": Number("id"), "type": "synonyms", "rule": [$parseTree.text], "value": $parseTree.text});
In the ECMAScript 6 runtime, the method is asynchronous:
await $caila.setClientEntityRecord("EntityName", {"id": Number("id"), "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. |
id | string | Yes | Record ID. |
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. |
tip
Use the
$caila.getClientEntityRecords
method to get the record IDHow to use
Update entity record:
- ECMAScript 5
- ECMAScript 6
state: Example
intent!: /Change
script:
$caila.setClientEntityRecord("ClientEntity", {"id": Number($parseTree._id), "type": "synonyms", "rule": [$parseTree._rule], "value": $parseTree._rule});
state: Example
intent!: /Change
scriptEs6:
await $caila.setClientEntityRecord("ClientEntity", {"id": Number($parseTree._id), "type": "synonyms", "rule": [$parseTree._rule], "value": $parseTree._rule});