Update Record
Table of Contents
Overview
This task is used to update a record in a specified application in Zoho Creator.
Syntax
<variable> = zoho.creator.v1.updateRecord(<ownerName>, <appLinkName>, <formLinkName>, <recordID>, <dataMap>, <connectionlinkName>);
where,
Params | Description | Data Type |
<variable> | KEY-VALUE | Variable which will hold the returned response. |
<ownerName> | TEXT | is the name of the owner of the app in which the record will be updated. Name of the app owner is present in the url while editing the app: creator.zoho.com/appbuilder/<appOwner> App owner name can also be fetched using the system variable zoho.adminuser |
<appLinkName> | TEXT | is the link name of the application in which the record will be updated. Link names of applications, forms, and fields in your account can be viewed here (listed in brackets). Application Link name can also be fetched using the system variable zoho.appname |
<formLinkName> | TEXT | is the link name of the form in which the record will be updated. Link names of applications, forms, and fields in your account can be viewed here (listed in brackets). |
<recordID> | NUMBER | is the ID of the record which will be updated. Record IDs can be fetched after creating or fetching records. |
<dataMap> | KEY-VALUE | contains field link names and their corresponding updated values. |
<connectionLinkName> (optional)* | TEXT | is the name of the Zoho Creator connection. *Note:
|
Example
Let us consider the below example of updating a record in Zoho Creator. Imagine that the user wants to update the Task Description of an existing record having a recordID - 3605445000000065010
Assume that we have a form with the two fields - Task_Name (Single Line Field Type) and Task_Description (Single Line Field Type). The arguments - Task_Management (Application Link Name), Create_Task (F Link Name), tony (Owner Name) will be supplied to the updateRecord task in the following example.
dataMap = {"Task_Description":"Toaster Configuration"};
response = zoho.creator.v1.updateRecord("tony", "Task_Management", "Create_Task", 3605445000000065010, dataMap);
where,
response
tony
Task_Management
Create_Task
3605445000000065010
datamap
Sample Response
Success
Following is a successful response received after updating a record.
"values": {
"criteria":"ID==3605445000000065010",
"newvalues":[{"Task_Description":"Toaster Configuration"}],
"status":"Success"
}
Error:
Following is an error when the owner name is incorrect.
"message":"Specified ownerName is not valid",
"status":"Failure"
}
Following is an error when the user tries to update a record with an incorrect application name.
"message":"Specified application name is not valid.Provide a correct one.",
"status":"Failure"
}
Related Links
- To fetch the string value to which the specified key is mapped, use get()
- To get values from fetched records, use getJSON()
- To get the Application Owner Name, Application Link Name, Form Link Name and/ or View Link Name, please visit Creator API Link Names