Create Record in Zoho FSM
Table of Contents
Overview
You can create a record in the specified module of FSM using the zoho.fsm.createRecord() task.
This task is based on Zoho FSM API -> <Module> APIs -> Create <ModuleName>
Syntax
<variable> = zoho.fsm.createRecord(<module_name>, <record_details>, <optional_data_map>, <connection>);
where,
Params | Data type | Description |
<variable> | KEY-VALUE | is the response returned by Zoho FSM. |
<module_name> | TEXT | is the API name of the Zoho FSM module where the record will be added. The API names of the modules are:
|
<record_details> | KEY-VALUE | is a map with details of the record that needs to be inserted into the module Note: To learn about the mandatory fields, click here and navigate to <Module> APIs -> Create <ModuleName>
|
<optional_data_map> (optional) | KEY-VALUE | is a Map parameter to pass any additional values. If you want to ignore this parameter, supply an empty map. Note: To learn about the optional parameters, click here and navigate to <Module> APIs -> Create <ModuleName> |
<connection> (optional) | TEXT | is the name of the connection. Note: Add relevant scopes as mentioned in Zoho FSM API -> <Module> -> Create <ModuleName>.
|
Example: Creating a Request record
The following script will create a Request record in FSM:
emptyMap = Map(); serviceAddress = Map(); serviceAddress.put("id", "1439XXXXXXXX1231"); billingAddress = Map(); billingAddress.put("id", "1439XXXXXXXX1230"); newRecordInfo = Map(); newRecordInfo.put("Summary", "Sample"); newRecordInfo.put("Status", "New"); newRecordInfo.put("Contact", "1439XXXXXXXX1222"); newRecordInfo.put("Territory","1439XXXXXXXX1185"); newRecordInfo.put("Service_Address",serviceAddress); newRecordInfo.put("Billing_Address",billingAddress); response = zoho.fsm.createRecord("Requests", newRecordInfo, emptyMap, "fsm_connection");
where:
newRecordInfo
"Summary" "Status" "Contact" "Territory" "Service_Address" "Billing_Address"
"Requests"
response
"fsm_connection"
Response Format
Success Response
The response returned is of the following format:
{
"result": "success",
"code": "SUCCESS",
"data": {
"Requests": [
{
"UID": "Requests_0",
"Modified_Time": "2022-05-16T03:56:17-07:00",
"Modified_By": {
"name": "Mary Cooper",
"id": "1439XXXXXXXX1001"
},
"Created_Time": "2022-05-16T03:56:17-07:00",
"id": "1439XXXXXXXX5716",
"Created_By": {
"name": "Mary Cooper",
"id": "1439XXXXXXXX1001"
},
"TabName": "Requests"
}
]
},
"status": "success"
}
To get the ID of the newly created record, execute the following script: