Zoho FSM | Updating Records

Updating Records

You can update a record of a module using the zoho.fsm.updateRecord() deluge task.

Syntax

Method UsedSyntax
Using the Internal Connection

<Response> = zoho.fsm.updateRecord(<module>, <NUMBER>, <KEY-VALUE>);

Using the Connection of a Service (Default/Custom)<Response> = zoho.fsm.updateRecord(<module>, <NUMBER>, <KEY-VALUE>, <optionalDataMap>, <connection>);
 
where,
<Response> is the task response returned as a Map.
<module> is the API name of the module from which you want to fetch records
<NUMBER> is the unique ID of the record you want to update.
<KEY-VALUE> is the map containing the key, value pairs denoting the fields to be updated, and the value with which the field should be updated.
<optionalDataMap> is a Map parameter to pass any additional values
<connection> The connection created for Zoho FSM

Example 

Update the Request record with ID 865000000086031. Update the value of the field Priority as Medium.
  1. newRecordInfo = Map();
  2. newRecordInfo.put("Priority", "Medium");
  3. //Use the below line of code if using the internal connection
  4. resp = zoho.fsm.updateRecord("Requests", "865000000086031", newRecordInfo);
  5. //Use the below line of code if using the connection of a service (default/custom)
  6. resp = zoho.fsm.updateRecord("Requests", 865000000086031, newRecordInfo, Map(), "fsmconnection");
  7. info resp;
Response Format
{"data":[{"code":"SUCCESS","details":{"Modified_Time":"2021-09-27T16:52:37-07:00","Modified_By":{"name":"Tracy Pollan","id":"865000000070001"},"Created_Time":"2021-09-23T00:06:44-07:00","id":"865000000086031","Created_By":{"name":"Tracy Pollan","id":"865000000070001"}},"message":"record updated","status":"success"}]}