Get Records from SDP Cloud
Table of Contents
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>);
Params | Data type | Description |
<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:
|
<connection> | TEXT | The name of the connection. Note:
|
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"
1
4
search_map
""
"sdp_connection"
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
- SDP Cloud API
- Common error codes can be viewed here
- The possible response formats can be viewed here