Zoho Creator - RPC APIs > XML RPC Methods > XML RPC - Delete Record

XML RPC - Delete Record

Tags:  

Delete record - XML Format



Zoho Creator XML
- RPC Web API allows client applications to delete records from a Zoho Creator form, using the HTTP POST method. The records that satisfy the given criteria will be deleted. You can specify multiple criteria using "AND"/ "OR" operator. In return, the user gets a formatted XML response from the called method. 

Who can delete a record ?

- Application  owner with valid API Key
- Shared users with valid API key and access permission to edit records in a view.


Delete record by application owner
Delete record by shared users


Delete Record by Application Owner
 
Request URL

The request url to delete a record in XML format is given below:

 http://creator.zoho.com/api/xml/write/apikey=[APIKEY]&ticket=[Ticket]

Request Format

The request parameters comprises of comma separated values to be specified in the following format:


<ZohoCreator>

<applicationlist>
<application name="app name">
</formlist>
<form name="form  name">
<delete>
<criteria>
<field name="field Name" compOperator="compOperator" value="field value"></field>
<reloperator>AND/OR</reloperator>
<field name="field Name" compOperator="compOperator" value="field value"></field>
</criteria>
</delete>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>



Note:
 
1. The values that can be specified for the <compOperator> is given below:

  • Equals
  • NotEqual
  • Before
  • After
  • LessThan
  • GreaterThan
  • LessThanOrEqual
  • GreaterThanOrEqual
  • Contains
  • NotContains
  • StartsWith
  • EndsWith

2. The values that can be specified for the <reloperator> is given below:
  • AND
  • OR
3. For fields of type multi-select, only one list value can be specified as criteria.

4. Only Deluge Script names must be specified for form names, field names and application name. Refer http://creator.zoho.com/api/referenceto view the list of applications created, the form names and field names used in each application and the deluge names. 


Sample Form (POST Method Format)

<form method="POST"    action="http://creator.zoho.com/api/xml/write/apikey=[APIKEY]&ticket=[Ticket]">

<input type="hidden" name="XMLString" value="XML String in the format as specified in the Request format">

<input type="submit" value="Submit XML String">

</form>



Sample Request 

1. Sample request to delete a single record:


<ZohoCreator>
<applicationlist>
<application name="sample">
<formlist>
<form name="Employee_Form">
<delete>
<criteria>
<field name="Name" compOperator="EQUALS" value="Smith"></field>
<reloperator>AND</reloperator>
<field name="Hobbies" compOperator="EQUALS" value="Reading"></field>
</criteria>
</delete>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>



2. Sample request to delete a record in multiple forms.

In the following sample, the delete criteria for each form is specified within seperate <form> </form> tags.


<ZohoCreator>

<applicationlist>
<application name="sample">
<formlist>
<form name="Employee_Form">
<delete>
<criteria>
<field name="Hobbies" compOperator="Contains" value="Music"></field>
</criteria>
</delete>
</form>

<form name="Department">
<delete>
<criteria>
<field name="Department_Name" compOperator="Equals" value="Administration"></field>
</criteria>
</delete>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>



3. Sample request to delete a record in multiple applications

The delete criteria for each form is specified within seperate <form> </form> tags.


<ZohoCreator>

<applicationlist>

<application name="sample">
<formlist>
<form name="Employee_Form">
<delete>
<criteria>
<field name="Joining_Date" compOperator="Before" value="01-01-2007"></field>
<reloperator>AND</reloperator>
<field name="Basic" compOperator="LessThanOrEqual" value="10000"></field>
</criteria>
</delete>
</form>
</formlist>
</application>

<application name="leave-application">
<formlist>
<form name="Leave_Form">
<delete>
<criteria>
<field name="Employee_Email" compOperator="EQUALs" value="smith@yahoo.com"></field>
</criteria>
</delete>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>



Sample Response

The response tags comprises of the form name, the delete criteria and the status as shown in the sample below:


<response>

<result>
<form name="Employee_Form>
<delete>
<criteria>
<field name="Name" compOperator="EQUALs" value="Smith"/>
<reloperator>AND</reloperator>
<field name="Hobbies" compOperator="EQUALs" value="Reading"/>
</criteria>
<status>Success</status>
</delete>
</form>
</result>
</response>


If there is an error in the request format, the corresponding error code with the error message will be displayed. Please refer the topic, Error codes and description, to learn about the list of error code displayed.

If the record is added to the database, the response message will be displayed with status as "Success".


Delete Record by Shared User
 

Request URL

The request url to delete a record in XML format is given below:

 http://creator.zoho.com/api/xml/write/apikey=[APIKEY]&ticket=[Ticket]

Request Format

The request parameters comprises of comma separated values to be specified in the following format:


<ZohoCreator>

<applicationlist>
<application name="app name">
</viewlist>
<view name="form  name">
<delete>
<criteria>
<field name="field Name" compOperator="compOperator" value="field value"></field>
<reloperator>AND/OR</reloperator>
<field name="field Name" compOperator="compOperator" value="field value"></field>
</criteria>
</delete>
</view>
</viewlist>
</application>
</applicationlist>
</ZohoCreator>


Note:
 
1. The values that can be specified for the <compOperator> is given below:

  • Equals
  • NotEqual
  • Before
  • After
  • LessThan
  • GreaterThan
  • LessThanOrEqual
  • GreaterThanOrEqual
  • Contains
  • NotContains
  • StartsWith
  • EndsWith

2. The values that can be specified for the <reloperator> is given below:
  • AND
  • OR
3. For fields of type multi-select, only one list value can be specified as criteria.

4. Only Deluge Script names must be specified for view names, field names and application name. Refer http://creator.zoho.com/api/referenceto view the list of applications created, the view names and field names used in each application and the deluge names. 


Sample Form (POST Method Format)

<form method="POST"    action="http://creator.zoho.com/api/xml/write/apikey=[APIKEY]&ticket=[Ticket]">

<input type="hidden" name="XMLString" value="XML String in the format as specified in the Request format">

<input type="hidden" name="zc_ownername" value="Application Owner Name">

<input type="submit" value="Submit XML String">

</form>


 


 RSS of this page