Choose where you’d like to start

Fetch Record from Zoho FSM using record ID

Description

You can fetch the information of a specific record using the zoho.fsm.getRecordById Deluge task.

This task is based on Zoho FSM API -> <Module> -> Get <ModuleName>.​

Syntax

<variable> = zoho.fsm.getRecordById(<module_name>, <record_ID>, <optional_data_map>, <connection>);

where:

ParamsData typeDescription
<variable>KEY-VALUEis the response returned by Zoho FSM.
<module_name>TEXT

is the API name of the module from which you want to fetch records. 

The API names of the modules are:
Assets, Companies, Contacts, Estimates, Requests,  Scheduled_Maintenances, Service_And_Parts, Service_Appointments, Territories, Time_Off, Work_Orders, Work_Types

<record_Id>NUMBER

is the unique ID of the record you want to retrieve.

Note: Learn how to fetch the ID of a record after creating or fetching it using Deluge.

<optional_data_map>

(optional)

KEY-VALUE

is a parameter to pass any additional values.

Note:

  • To learn about the optional parameters, click here and go to <moduleName> -> Get <moduleName>.
  • To ignore querying using this param, provide an empty map.
    For example: { "" : "" }

<connection>

(optional)

TEXT

is the name of the connection created for Zoho FSM.

Note: Add relevant scopes as mentioned in Zoho FSM API -> <Module> -> Get <ModuleName>. 

 

Example

The following script fetches the record with ID - 23033XXXXXXXXXXXXXX in the Zoho FSM module - Requests.

 emptyMap = Map();
 response = zoho.fsm.getRecordById("Requests", 23033XXXXXXXXXXXXXX, emptyMap, "fsm_connection"); 

where,

response
is the KEY-VALUE response returned by Zoho FSM.
"Requests"
is the TEXT that represents the API name of the Zoho FSM module from which the record needs to be fetched.
"fsm_connection"
is the TEXT that represents the link name of the connection created for Zoho FSM.

Response Format

The success response returned is of the following format:


  "data": [ 
    { 
      "Owner": { 
        "name": "Mary Cooper", 
        "id": "1439000000161001", 
        "email": "shawn@zylker.com" 
      }, 
      "Company": { 
        "name": "ABC Services", 
        "id": "1439000000161212" 
      }, 
      "Email": "betty@zylker.com", 
      "$currency_symbol": "$", 
      "Cancellation_Reason": null, 
      "Config": "{\"sales_tax_type\":\"exclusive\",\"tax_rounding_type\":\"not_configured\",\"Type\":\"32\",\"is_discount_before_tax\":true,\"is_inclusive_tax\":false,\"is_discount_tax_inclusive\":false,\"discount_type\":\"entity_level\",\"is_sales_inclusive_tax_enabled\":false,\"transaction_rounding_type\":\"no_rounding\",\"is_registered_for_tax\":true,\"Tax_Details\":{\"Tax_Percentage\":7,\"Tax_Id\":\"3219741000000078015\",\"taxFromModule\":\"Addresses\",\"Tax_Name\":\"SalesTax\",\"Taxable\":true}}", 
      "Closed_Time": null, 
      "Reported_By": null, 
      "Cancelled_Or_Terminated_Time": null, 
      "Dispatcher": { 
        "name": "Mary Cooper", 
        "id": "1439000000161001" 
      }, 
      "Name": "REQ1", 
      "Work_Orders": [ 
        { 
          "Owner": { 
            "name": "Mary Cooper", 
            "id": "1439000000161001", 
            "email": "shawn@zylker.com" 
          }, 
          "Estimate": null, 
          "Company": { 
            "name": "ABC Services", 
            "id": "1439000000161212" 
          }, 
          "Email": "betty@zylker.com", 
          "Discount": 0, 
          "$currency_symbol": "$", 
          "Cancellation_Reason": null, 
          "Config": "{\"sales_tax_type\":\"exclusive\",\"tax_rounding_type\":\"not_configured\",\"Type\":\"32\",\"is_discount_before_tax\":true,\"is_inclusive_tax\":false,\"is_discount_tax_inclusive\":false,\"discount_type\":\"entity_level\",\"is_sales_inclusive_tax_enabled\":false,\"transaction_rounding_type\":\"no_rounding\",\"is_registered_for_tax\":true,\"Tax_Details\":{\"Tax_Percentage\":7,\"Tax_Id\":\"3219741000000078015\",\"taxFromModule\":\"Addresses\",\"Tax_Name\":\"SalesTax\",\"Taxable\":true}}", 
          "Closed_Time": null, 
          "Cancelled_Or_Terminated_Time": null, 
          "Dispatcher": { 
            "name": "Mary Cooper", 
            "id": "1439000000161001" 
          }, 
          "Name": "WO9", 
          "Tax_Amount": 7, 
          "Invalid_Data": false, 
          "Modified_By": { 
            "name": "Mary Cooper", 
            "id": "1439000000161001", 
            "email": "shawn@zylker.com" 
          }, 
          "Exchange_Rate": 1, 
          "Phone": "111-111-1111", 
          "Cancellation_Message": null, 
          "Currency": "USD", 
          "$inactive": false, 
          "Service_Address": { 
            "Service_Latitude": 41.491496, 
            "Service_Street_1": "4117 Kennedy Dr", 
            "Service_State": "Illinois", 
            "Service_Zip_Code": "61244", 
            "name": "AD-2", 
            "id": "1439000000161231", 
            "Service_Longitude": -90.457028, 
            "Service_Address_Name": "Service Address", 
            "Service_Street_2": null, 
            "Service_City": "East Moline", 
            "Service_Country": "United States" 
          }, 
          "Asset": null, 
          "id": "1439000000185184", 
          "Discount_Type": "Currency", 
          "Status": "New", 
          "Grand_Total": 107, 
          "Territory": { 
            "name": "Colona", 
            "id": "1439000000161185" 
          }, 
          "Modified_Time": "2022-05-16T00:48:59-07:00", 
          "Due_Date": null, 
          "Adjustment": 0, 
          "Priority": "Medium", 
          "Created_Time": "2022-05-13T00:51:11-07:00", 
          "Request": { 
            "name": "REQ1", 
            "id": "1439000000185139" 
          }, 
          "Sub_Total": 100, 
          "$editable": true, 
          "Completed_Time": null, 
          "Billing_Status": "-None-", 
          "$permissions": { 
            "read": true, 
            "edit": true, 
            "delete": true 
          }, 
          "Contact": { 
            "name": "Lucy Robins", 
            "id": "1439000000161222" 
          }, 
          "Type": "Service", 
          "Parent_Work_Order": null, 
          "Preference": { 
            "Preferred_Date_1": null, 
            "Preferred_Date_2": null, 
            "Preference_Note": null, 
            "Preferred_Time": null 
          }, 
          "Billing_Address": { 
            "Billing_Longitude": -90.358476, 
            "Billing_City": "Colona", 
            "Billing_Country": "United States", 
            "name": "AD-1", 
            "Billing_Address_Name": "Billing Address", 
            "Billing_Street_1": "901 1st St", 
            "Billing_State": "Illinois", 
            "Billing_Zip_Code": "61241", 
            "Billing_Street_2": null, 
            "Billing_Latitude": 41.469353, 
            "id": "1439000000161230" 
          }, 
          "Summary": "Bathroom floor repair", 
          "Created_By": { 
            "name": "Mary Cooper", 
            "id": "1439000000161001", 
            "email": "shawn@zylker.com" 
          } 
        } 
      ], 
      "Modified_By": { 
        "name": "Mary Cooper", 
        "id": "1439000000161001", 
        "email": "shawn@zylker.com" 
      }, 
      "Exchange_Rate": 1, 
      "Phone": "111-111-1111", 
      "Cancellation_Message": null, 
      "Currency": "USD", 
      "$inactive": false, 
      "Service_Address": { 
        "Service_Latitude": 41.491496, 
        "Service_Street_1": "4117 Kennedy Dr", 
        "Service_State": "Illinois", 
        "Service_Zip_Code": "61244", 
        "name": "AD-2", 
        "id": "1439000000161231", 
        "Service_Longitude": -90.457028, 
        "Service_Address_Name": "Service Address", 
        "Service_Street_2": null, 
        "Service_Country": "United States", 
        "Service_City": "East Moline" 
      }, 
      "Asset": null, 
      "id": "1439000000185139", 
      "Status": "Work In Progress", 
      "Territory": { 
        "name": "Colona", 
        "id": "1439000000161185" 
      }, 
      "Modified_Time": "2022-05-16T00:48:58-07:00", 
      "Due_Date": null, 
      "Priority": "Medium", 
      "Created_Time": "2022-05-12T03:42:38-07:00", 
      "$editable": true, 
      "Completed_Time": null, 
      "$permissions": { 
        "read": true, 
        "edit": true, 
        "delete": true 
      }, 
      "Estimate_Required": false, 
      "Contact": { 
        "name": "Lucy Robins", 
        "id": "1439000000161222" 
      }, 
      "Parent_Work_Order": null, 
      "Request_Origin": null, 
      "Preference": { 
        "Preferred_Date_1": null, 
        "Preferred_Date_2": null, 
        "Preference_Note": null, 
        "Preferred_Time": null 
      }, 
      "Billing_Address": { 
        "Billing_Longitude": -90.358476, 
        "Billing_City": "Colona", 
        "Billing_Country": "United States", 
        "name": "AD-1", 
        "Billing_Address_Name": "Billing Address", 
        "Billing_Street_1": "901 1st St", 
        "Billing_State": "Illinois", 
        "Billing_Zip_Code": "61241", 
        "Billing_Street_2": null, 
        "Billing_Latitude": 41.469353, 
        "id": "1439000000161230" 
      }, 
      "Summary": "Bathroom floor repair", 
      "Created_By": { 
        "name": "Mary Cooper", 
        "id": "1439000000161001", 
        "email": "shawn@zylker.com" 
      } 
    } 
  ] 
}

Related Links

Get Started Now

Execute