Delete Records
Table of Contents
Note: This task is applicable to all Zoho Services except Zoho Creator.
Overview
This task is used to delete records from a Zoho Cliq database based on a specified criteria.
This task is based on Zoho Cliq API - Delete a record.
Syntax
<variable> = zoho.cliq.deleteRecords(<database_name>, <query_text>, <connection>);
where,
Params | Data type | Description |
<variable> | KEY-VALUE | specifies the variable which will hold the response returned by Zoho Cliq. |
<database_name> | TEXT | specifies the unique name of the database from which the records will be deleted. |
<query_text> | TEXT | specifies the query parameters. Click here to find the list of operators that can be used in the search criteria. |
<connection> | TEXT | specifies the link name of the Zoho Cliq connection. Note:
|
Example 1: Delete the records that satisfy static criteria
The following example deletes all the records from the Zoho Cliq database - availabilitydatabase that has the value - false in the column - availability.
response_map = zoho.cliq.deleteRecords("availabilitydatabase","availability==false", "cliq_connection");
where,
response_map
"availabilitydatabase"
"availability==false"
"cliq_connection"
Example 2: Delete the records that satisfy dynamic criteria
Write the below script in the message handler of your Bot configuration to delete records from the Zoho Cliq database - availabilitydatabase that has the value specified by the user in the column - name.
response = Map(); dynamic_value = message; query_text = "name==" + dynamic_value; response_map = zoho.cliq.deleteRecords("availabilitydatabase", query_text, "cliq_connection"); response.put("text", response_map); return response;
where,
response_map
dynamic_value
query_text
"cliq_connection"
Sample Response
Success Response
The success response returned is of the following format
{"status":"SUCCESS"}
Failure Response
The failure response returned for an incorrect database name is of the following format
{
"status":"FAILURE",
"message":"Uh-oh! Looks like availabilitydata does not exist.",
"code":"platform_storage_database_not_found"
}
Related Links
- Zoho Cliq API
- Common error codes can be viewed here