$caila.getClientEntityRecords
Returns the list of all the records of an entity for a certain client.
tip
Use the
$caila.getEntity
method to get the list of common entity records not specific for a certain client.Syntax
The method accepts the entity name and the clientId
as arguments:
- ECMAScript 5
- ECMAScript 6
$caila.getClientEntityRecords("ClientEntity");
In the ECMAScript 6 runtime, the method is asynchronous:
await $caila.getClientEntityRecords("ClientEntity");
Parameter | Type | Mandatory | Description |
---|---|---|---|
EntityName | string | Yes | Name of the entity where the record is to be added. |
clientId | string | No | Client ID. |
classifierToken | string | No | API key used to access an external trained classifier. |
How to use
Script:
- ECMAScript 5
- ECMAScript 6
state: Example
q!: records
a: The following records were created for the ClientEntity entity and the {{$request.channelUserId}} client:
a: {{JSON.stringify($caila.getClientEntityRecords("ClientEntity"))}}
state: Example
q!: records
a: The following records were created for the ClientEntity entity and the {{$request.channelUserId}} client:
scriptEs6:
$reactions.answer(JSON.stringify(await $caila.getClientEntityRecords("ClientEntity")));
List of records for the ClientEntity
entity:
{
"id":711091, //record ID
"type":"pattern", //method used to specify the record value
"rule":"two", //record value
"value":"2" //value associated with the record
},
{
"id":711090,
"type":"synonyms",
"rule":"one",
"value":"1"
},
{
"id":711092,
"type":"synonyms",
"rule":"three",
"value":"3"
}