Update Record by ID
Table of Contents
Overview
This JS API task updates a specific record displayed in a report of a Zoho Creator application. The record is identified by its ID value. The update operation is subject to data validations configured for the corresponding form.
This task is based on the Update Record by ID REST API V2.1. Learn more about understanding the response
Request Details
Syntax
ZOHO.CREATOR.DATA.updateRecordById(config).then(function(response){
//callback block
});
Syntax Details
The syntax holds:
- <config> (object) - The configuration required to update a record in a report. This configuration includes the following parameters.
Name | Type | Description |
app_name (Optional) | string | Link name of the application that data needs to be pushed to. Retrieve the link name using the Creator report's URL: https://creatorapp.zoho.com/<account_name>/<app_name>/#Report:<report_name> Note: This parameter only needs to be passed when you need to push data in other applications of the same Creator account. When not specified, data will be pushed to the current application. |
report_name | string | Link name of the report in which record needs to be updated. Retrieve the link name using the Creator report's URL: https://creatorapp.zoho.com/<account_name>/<app_name>/#Report:<report_name> |
payload | object | Form data supplied in JSON format to update the record with the field values within, in the form. The field link names necessary for the key-value pairs can be obtained from the field properties in form builder. Refer to the Setting Field Values section to learn more about the format. |
Payload Parameter
- skip_workflow list
(Optional)
Prevents the associated workflows from being executed on the update of a record.
Possible values: form_workflow, schedules, all
Note: By default:
- When more than one type of workflow is mentioned, supply them as comma-separated values in a list. For example,
"skip_workflow" : ["schedules","form_workflow"] - If this parameter is not supplied, all associated workflows will be triggered.
- Blueprints and approvals will be triggered on the update of a record and cannot be skipped.
Possible Errors
Refer to this page for the complete list of error codes and messages.
Sample Input
Copiedvar config = {
app_name: "zylker",
report_name: "All-Timesheet",
id: "2000000245119",
payload: {
"data": {
"Name": {
"first_name": "James",
"last_name": "Kyle"
}
} }
};
ZOHO.CREATOR.DATA.updateRecordById(config).then(function (response) {
if (response.code == 3000) {
console.log(response);
} });
Sample Response
Copiedresponse = {
"code": 3000,
"data": {
"ID": "2000000245119"
},
"message": "success"
}