Update Transitions
Table of Contents
Overview
You can update the status of the record in the specified transactional module using the zoho.fsm.updateTransitions() Deluge task.
This task is based on Zoho FSM API -> <Module> -> List <ModuleName> Transitions.
Note: This task is not applicable to Zoho Creator.
Syntax
<variable> = zoho.fsm.updateTransitions(<module_name>, <record_id>,<transition_details>, <optional_data_map>, <connection>);
where,
Params | Data type | Description |
<variable> | KEY-VALUE | is the task response returned as a Map. |
<module_name> | TEXT | is the API name of the module whose record's transitions you want to update. Note: To know the API name, click here, navigate to <Module> APIs -> Perform an <ModuleName> Transition and refer to the Request URL |
<record_id> | TEXT | is the unique ID of the record whose transitions you want to update. |
<transition_details> | KEY-VALUE | is a Map parameter to pass the details required to move the record from one status to another. |
<optional_data_map> | KEY-VALUE | is a Map parameter to pass any additional values. If you want to ignore this parameter, supply an empty map. |
<connection> | TEXT | is the connection created for Zoho FSM. Note: To know the relevant scopes, click here, navigate to <Module> APIs -> List <ModuleName> Transitions. |
Example
The following script will update the status of a record with ID 23033XXXXXXXXXXXXXX in the Zoho FSM module Service Appointments to Cannot Complete.
emptyMap = Map();
transitionInfo = Map();
transitionInfo = {"blueprint":[{"transition_id":"2373000000169069","data":{"Notes":"Customer not present at the location"}}]};
response = zoho.fsm.updateTransitions("Service_Appointments", 23033XXXXXXXXXXXXXX, transitionInfo, emptyMap, "fsm_connection");
info response;
info response;
where:
"Service_Appointments"
23033XXXXXXXXXXXXXX
transitionInfo
is the KEY-VALUE input with details to update the status of the record.
The transition_id is the NUMBER that represents the status to which you want to update the record. To know the transition_id, click here, navigate to <Module> APIs -> List <ModuleName> Transitions
The data is the KEY-VALUE input with the details of the note that need to be added when cancelling or terminating a record.
"fsm_connection"
Response Format
Success Response
The response returned is of the following format:
{"code":"SUCCESS","details":{},"message":"Action executed successfully","actions":{"before":{},"after":{}},"status":"success"}