Update record by ID in Zoho Creator v2.1

Overview

The zoho.creator.v2_1.updateRecordById task allows you to update an existing record in a specified Zoho Creator form using its record ID. This task is useful when you want to modify field values of an existing record programmatically instead of editing them manually through the application interface.

Note: The record ID is a unique identifier automatically generated for each record in Zoho Creator.

Syntax

response = zoho.creator.v2_1.updateRecordById(ownerName: "owner_name", appLinkName: "app_link_name", formLinkName: "form_link_name", recordId: "record_id", data: map_variable);

where,

ParameterDescriptionData type
ownerNameThe Zoho Creator account owner’s username.Text
appLinkNameThe link name of the application in which the form exists.Text
formLinkNameThe link name of the form containing the record to be updated.Text
recordIdThe unique ID of the record you want to update.Text
dataA map variable containing field-value pairs to be updated in the record.Map

Example

// Create a KEY-VALUE variable to hold the input record values
data_map = Map();
data_map.put("Task_Name", "Priority Task");
data_map.put("Task_Description", "I need help configuring my new toaster");

// Create an empty KEY-VALUE variable or null to skip the other_params parameter
optional_params = Map();
workflows = List();
workflows.add("form_workflow");
workflows.add("schedules");
optional_params.put("environment", "stage");
optional_params.put("tasks",true);
optional_params.put("skip_workflow",workflows);
optional_params.put("message",true);
response = zoho.creator.v2_1.updateRecordById("Shawn", "Task_Management", "All_Tasks", "60210000000020007", data_map, optional_params, "creator_oauth_connection"); 

Response format

Success response

{
"code": 3000,
"data": {
"Email": "jason@zylker.com",
"Single_Line": "Single Line of Text",
"ID": "3888833000000114027"
},
"message": "Data Updated Successfully!",
"tasks": {
"openurl": {
"type": "Same window",
"url": "http://www.zylker.com"
}
}
}

Failure response

{
  "code": 3101,
  "message": "The record ID provided does not exist or you do not have permission to update this record."
}

Things to know

  • Ensure that the record ID provided is valid and corresponds to the specified form.
  • Field link names in the data map must exactly match the ones defined in your form.
  • Only fields that you include in the data map will be updated; other fields remain unchanged.

Related links