Edit Record - XML Format
Zoho Creator XML - RPC Web API allows client applications to update records from a Zoho Creator form, using the HTTP POST method. The
records that satisfy the given criteria will be updated. You can
specify multiple criteria using "AND"/ "OR" operator. In return, the
user gets a formatted
XML response from the called method.
Who can update a record ?
- Application owner with valid API Key
- Shared users with valid API key and access permission to edit records in a view.
Update record by application owner
Update record by shared users
Update Record by Application Owner
Request URL
The request url to edit 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>
<update>
<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>
<newvalues><field name="set field Name" value="field value"></field>
</newvalues> </update> </form>
</application>
</applicationlist>
</ZohoCreator>
Note:
1. 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.
2. The values that can be specified for the <compOperator> is given below:
- Equals
- NotEqual
- Before
- After
- LessThan
- GreaterThan
- LessThanOrEqual
- GreaterThanOrEqual
- Contains
- NotContains
- StartsWith
- EndsWith
3. The values that can be specified for the <reloperator> is given below:
4. For fields of type multi-select, only one list value can be specified as criteria.
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="Sumit XML String">
</form>
Sample Request
1. Sample request to update a record in a form using compOperator="EQUALS" and relOperator="AND"
<ZohoCreator>
<applicationlist>
<application name="sample">
<formlist>
<form name="Employee_Form">
<update>
<criteria>
<field name="Name" compOperator="EQUALS" value="Smith"></field>
<reloperator>AND</reloperator>
<field name="Hobbies" compOperator="EQUALS" value="Reading"></field>
</criteria>
<newvalues>
<field name="Joining_Date" value="28-Dec-2006"></field>
</newvalues>
</update>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>
2. Sample request to update a record in a form using compOperator="BEFORE", "LessThanOrEqual" and relOperator="AND"
<ZohoCreator>
<applicationlist>
<application name="
sample">
<formlist>
<form name="
Employee_Form">
<update>
<criteria>
<field name="Joining_Date" compOperator="Before" value="01-01-2007"></field>
<reloperator>AND</reloperator>
<field name="Basic" compOperator="LessThanOrEqual" value="10000"></field>
</criteria>
<newvalues>
<field name="Basic" value="25000"></field>
</newvalues>
</update>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>
3. Sample
request to update a record in multiple forms.The update criteria and
values for each form is specified within seperate <form>
</form> tags.
<ZohoCreator>
<applicationlist>
<application name="
sample">
<formlist>
<form name="
Employee_Form">
<update>
<criteria>
<field name="Hobbies" compOperator="Contains" value="Music"></field>
</criteria>
<newvalues>
<field name="Hobbies" value="Gardening"></field>
</newvalues>
</update>
</form>
<form name="
Department">
<update>
<criteria>
<field name="Department_Name" compOperator="Equals" value="Administration"></field>
</criteria>
<newvalues>
<field name="Department_Name" value="ADMIN"></field>
</newvalues>
</formlist>
</application>
</applicationlist>
</ZohoCreator>
4.Sample
request to update a record in multiple applications. The update criteria and values for each form is specified within seperate <form> </form> tags.Each application is specirfied within <application>, </application> tag.
<ZohoCreator>
<applicationlist>
<application name="
sample">
<formlist>
<form name="
Employee_Form">
<update>
<criteria>
<field name="Joining_Date" compOperator="Before" value="01-01-2007"></field>
<reloperator>AND</reloperator>
<field name="Basic" compOperator="LessThanOrEqual" value="10000"></field>
</criteria>
<newvalues>
<field name="Basic" value="25000"></field>
</newvalues>
</update>
</form>
</formlist>
</application>
<application name="
leave-application">
<formlist>
<form name="
Leave_Form">
<update>
<criteria>
<field name="Employee_Email" compOperator="Contains" value="smith@yahoo.com"></field>
</criteria>
<newvalues>
<field name="Leave_Type" value="On Duty"></field>
</newvalues>
</update>
</form>
</formlist>
</application>
</applicationlist>
</ZohoCreator>
Response Format
The response parameters comprises of comma seperated values in the format given below:
<response>
<result>
<form name="Employee_Form">
<update>
<criteria>
<field name="Name" compOperator="EQUALs" value="Smith"/>
<reloperator>AND</reloperator>
<field name="Hobbies" compOperator="EQUALs" value="Reading"/>
</criteria>
<newvalues>
<field name="Joining_Date"><value>28-Dec-2006</value></field>
</newvalues>
<status>
Success</status>
</update>
</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".
Sample Response
The
following is the sample response for the above method:
<response><result>
<form name="
Employee_FormE>
<update>
<criteria>
<field name="Name" compOperator="EQUALs" value="Smith"/>
<reloperator>AND</reloperator>
<field name="Hobbies" compOperator="EQUALs" value="Reading"/>
</criteria>
<newvalues>
<field name="Joining_Date">
<value>28-Dec-2006</value>
</field>
</newvalues>
<status>Success</status>
</update>
</form>
</result>
</response>
Update Record by Shared User
Request URL
The request url to edit 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>
<update>
<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>
<newvalues><field name="set field Name" value="field value"></field>
</newvalues> </update> </view>
</application>
</applicationlist>
</ZohoCreator>
Note:
1. 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.
2. The values that can be specified for the <compOperator> is given below:
- Equals
- NotEqual
- Before
- After
- LessThan
- GreaterThan
- LessThanOrEqual
- GreaterThanOrEqual
- Contains
- NotContains
- StartsWith
- EndsWith
3. The values that can be specified for the <reloperator> is given below:
4. For fields of type multi-select, only one list value can be specified as criteria.
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="Sumit XML String">
</form>