Update Record

Table of Contents

Overview

This JS API task updates specific records displayed in a report of a Zoho Creator application. The records are 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. Learn more about understanding the response

Request Details

Syntax

ZOHO.CREATOR.API.updateRecord(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.
NameTypeDescription
appName
(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/<accountName>/<appName>/#Report:<reportName>

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.
reportNamestringLink 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/<accountName>/<appName>/#Report:<reportName>
idstring

Record ID of the record that needs to be updated.

Note: To update multiple records, specify the record IDs as comma-separated values.

dataobject

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.

Possible Errors

Refer to this page for the complete list of error codes and messages.

Sample Input

Copiedvar config = { 
       appName : "zylker",
       reportName : "All-Timesheet", 
       id : "2000000245119",
       data : formData 
} 
ZOHO.CREATOR.API.updateRecord(config).then(function(response){
    if(response.code == 3000){
        console.log("Record updated successfully");
    } 
});

Sample Response

Copiedresponse = {
 "code": 3000,
 "data": {  
  "ID": "2000000245119"
    },
 "message": "success"
}