Choose where you’d like to start

Get Records from SDP Cloud

Note: This task is applicable to all Zoho services, except Zoho Creator.

Overview

The zoho.sdp.getRecords task fetches the records from the specified module of SDP Cloud.

This integration task is based on the SDP Cloud API - List Info.

Syntax

<response> = zoho.sdp.getRecords(<module>, <index>, <range>, <search_value>, <app_account_name>, <connection>);
ParamsData typeDescription

<response> 

KEY-VALUE

The details of the records that will be fetched.

<module>

TEXT

The name of the module from which the records will be fetched.

Currently, only "Request" is the applicable module.

<index>

NUMBER

The index value starting from which the records will be fetched.

The index value begins from 1.

<range>

NUMBER

The number of records that will be fetched.

The maximum value is 100.

<search_value>

KEY-VALUE

The criteria with which the records will be searched.

You can specify an empty key-value for this param, in which case all the records will be fetched.

The keys of this parameter should be specified as given in the SDP Cloud API help page. The keys are case sensitive.

<app_account_name>

TEXT

The name of the account in which this task will be performed.

Note:
  • The account_name can be obtained from the SDP Cloud URL. The URL is in the following format:
    https://sdpondemand.zoho.com/app/<account_name>/HomePage.do
  • You can specify an empty string for this param, in which case the task is performed in the default account.

<connection>

TEXT

The name of the connection.

Note:

  • In view of stopping new authtoken generation, a Zoho OAuth connection with appropriate scopes is mandatory for new integration tasks (created after the deadline specified in the post) to work as expected. Existing integration tasks will continue to work with or without the connections parameter unless the authtoken is manually deleted from accounts.
  • Add relevant scopes mentioned in SDP Cloud API document while creating the connection.
  • Refer to this post for the list of Zoho services that support the connections page.
  • Learn more about connections

Example: Fetch records that satisfy a criteria

The following script fetches the records from the SDP Cloud module - Request with subject - OS installation:

 criteria_map = Map();
 criteria_map.put("field", "subject");
 criteria_map.put("condition", "is");
 criteria_map.put("value", "OS installation");
 
 // Create a map to hold the search values
 search_map = Map();
 search_map.put("search_criteria", criteria_map);
 
 //Perform get records task to fetch the required records
 response = zoho.sdp.getRecords("Request", 1, 4, search_map, "", "sdp_connection");

where:

"Request"
The TEXT that represents the module from which the records need to be fetched.
1
The NUMBER that represents the start index from which the records need to be fetched.
4
The NUMBER that represents the number of records that need to be fetched.
search_map
The KEY-VALUE variable that holds the criteria that needs to be satisfied.
""
Empty TEXT to denote that records should be fetched from the default account.
"sdp_connection"
The connection link name in TEXT format.

Response Format

Success Response

  • The success response returned will be in the following format:
     {
     "response_status": [
     {
     "status_code": 2000,
     "status": "success"
     }
     ],
     "list_info": {
     "has_more_rows": false,
     "start_index": 1,
     "row_count": 2
     },
     "requests": [
     {
     "template": {
     "name": "Default Request",
     "id": "317XXXXXXXXXX655"
     },
     "display_id": "1",
     "subject": "OS installation",
     "notification_status": null,
     "description": null,
     "responded_time": null,
     "is_read": false,
     "is_service_request": false,
     "urgency": null,
     "id": "317XXXXXXXXXX348",
     "group": null,
     "requester": {
     "email_id": null,
     "is_technician": false,
     "sms_mail": null,
     "phone": null,
     "name": "Tom",
     "mobile": null,
     "id": "317XXXXXXXXXX338",
     "photo_url": "https://contacts.zoho.com/file?exp=10&ID=-1&t=user&height=60&width=60",
     "is_vip_user": false,
     "department": null
     },
     "created_time": {
     "display_value": "Sep 20, 2019 05:01 PM",
     "value": "1568979088854"
     },
     "has_draft": false,
     "has_attachments": false,
     "approval_status": null,
     "sla": null,
     "is_overdue": false,
     "technician": null,
     "priority": null,
     "created_by": {
     "email_id": "shawn@zylker.com",
     "is_technician": true,
     "sms_mail": null,
     "phone": null,
     "name": "Shawn",
     "mobile": null,
     "id": "317XXXXXXXXXX318",
     "photo_url": "https://contacts.zoho.com/file?exp=10&ID=58XXXX60&t=user&height=60&width=60",
     "is_vip_user": false,
     "department": null
     },
     "due_by_time": null,
     "is_fcr": false,
     "first_response_due_by_time": null,
     "site": null,
     "is_first_response_overdue": false,
     "has_notes": false,
     "status": {
     "in_progress": true,
     "internal_name": "Open",
     "stop_timer": false,
     "color": "#0066ff",
     "name": "Open",
     "id": "317XXXXXXXXXX657"
     }
     }
     ]
     }
     
   

To fetch the record IDs from the success response, execute the following snippet:

 record_details =<response_variable>.get("requests");
 for each rec in record_details
 {
 info rec.get("id");
 }

Related Links

Get Started Now

Execute