Get Transitions

Note:

  • Each time the zoho.fsm.getTransitions integration task is executed, it triggers an API request in the back-end. This call is deducted from the external calls limit available for the service from which the task is executed, based on your pricing plan.
  • Only actual executions that receive a response (whether success or failure) are counted, not the number of times the task appears in the script. For example, if zoho.fsm.getTransitions integration task is placed inside a for each task that iterates five times, the number of external calls consumed will be five, even though the task appears only once in the script. 

Overview

Using the zoho.fsm.getTransitions Deluge task you can fetch all the possible transitions (statuses) the record in the specified module can take from its current status.
E.g. if a service appointment is in the Dispatched status, then the possible transitions (statuses) the service appointment can take are In Progress, Cannot Complete, and Cancelled.

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.getTransitions(<module_name>, <record_id>, <optional_data_map>, <connection>);

where,

ParamsData typeDescription
<variable> KEY-VALUEis the task response returned as a Map.
<module_name>TEXT

is the API name of the module whose record's transitions you want to fetch.

Note: To know the API name, click here, navigate to <Module> APIs -> List <ModuleName> Transitions and refer to the Request URL

<record_id>TEXTis the unique ID of the record whose transitions you want to retrieve.
<optional_data_map>KEY-VALUEis 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 fetches all the transitions for the record with ID - 23033XXXXXXXXXXXXXX in the Zoho FSM module - Service Appointments.

emptyMap = Map();
response = zoho.fsm.getTransitions("Service_Appointments", 23033XXXXXXXXXXXXXX, emptyMap, "fsm_connection");
info response;

where:

"Service_Appointments"
is the TEXT that represents the API name of the Zoho FSM module for whose record you want to fetch the transitions
23033XXXXXXXXXXXXXX
is the TEXT that represents the ID of the record whose transitions you want to fetch.
"fsm_connection"
is the TEXT that represents the link name of the connection created for Zoho FSM.

Response Format

Success Response

  • The response returned is of the following format:

     {"code":"SUCCESS","process_info":{"field_id":"2373000000115398","api_name":"Status","field_label":"Status","name":"Service Appointments","field_value":"New"},"transitions":[{"next_field_value":"Scheduled","name":"Schedule","id":"2373000000169054","type":"primary","enabled":true},{"next_field_value":"Cancelled","name":"Cancel","id":"2373000000169066","fields":[{"display_label":"Notes","data_type":"notes","id":"0","transition_sequence":1,"mandatory":true}],"enabled":true},{"next_field_value":"Cannot Complete","name":"Terminate","id":"2373000000169069","fields":[{"display_label":"Notes","data_type":"notes","id":"0","transition_sequence":1,"mandatory":true}],"enabled":true},{"next_field_value":null,"name":"Download","id":"2373000000298004","enabled":true},{"next_field_value":null,"name":"Print","id":"2373000000298008","enabled":true}],"status":"success"}

Related Links