Choose where you’d like to start

Create Record in SDP Cloud

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

Overview

The zoho.sdp.create task creates a new record with the given values in the specified module of SDP Cloud.

This integration task is based on the SDP Cloud API - Create Request.

Syntax

<response> = zoho.sdp.create(<module>, <data_map>, <app_account_name>, <connection>);
ParamsData typeDescription

<response> 

KEY-VALUE

The details of the record that will be created.

<module>

TEXT

The name of the module in which the new record will be created.

Currently, only "Request" is the applicable module.

<data_map>

KEY-VALUE

The values of the new record that will be created.

The keys of this parameter should be specified as given in the SDP Cloud API.

<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

The following script creates a new record with the specified values in the module - Request:

 // Create a KEY-VALUE variable to hold the values of the new record
 recordValue = Map();
 recordValue.put("subject", "OS installation");
 recordValue.put("requester", {"name":"Shawn"});
 recordValue.put("category", {"name":"Operating System"});
 recordValue.put("subcategory", {"name":"Windows XP"});
 
 //Execute the integration task to create a new record in the SDP Cloud module - Request
 response = zoho.sdp.create("Request", recordValue, "", "sdp_connection");

where:

response
The KEY-VALUE response variable that holds the details of the record that will be created.
"Request"
The TEXT that represents the name of the module in which the new record needs to be created.
recordValue
The KEY-VALUE variable that holds the values of the new record that needs to be created.
""
Empty TEXT to denote creation of record in 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:
     {
     "request": {
     "subject": "OS installation",
     "resolution": null,
     "linked_to_request": null,
     "mode": null,
     "lifecycle": null,
     "is_read": false,
     "assets": [
     ],
     "is_trashed": false,
     "id": "317XXXXXXXXXX348",
     "assigned_time": null,
     "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
     },
     "email_to": [
     ],
     "created_time": {
     "display_value": "Sep 20, 2019 05:01 PM",
     "value": "1568979088854"
     },
     "item": null,
     "level": null,
     "approval_status": null,
     "impact": null,
     "sla": null,
     "resolved_time": null,
     "priority": null,
     "created_by": {
     "email_id": "tom@zylker.com",
     "is_technician": true,
     "sms_mail": null,
     "phone": null,
     "name": "Shawn",
     "mobile": null,
     "id": "3173000000115318",
     "photo_url": "https://contacts.zoho.com/file?exp=10&ID=58XXXX60&t=user&height=60&width=60",
     "is_vip_user": false,
     "department": null
     },
     "first_response_due_by_time": null,
     "is_escalated": false,
     "last_updated_time": {
     "display_value": "Sep 20, 2019 05:01 PM",
     "value": "1568979089117"
     },
     "has_notes": false,
     "udf_fields": {
     },
     "impact_details": null,
     "subcategory": {
     "name": "Windows XP",
     "id": "317XXXXXXXXXX747"
     },
     "deleted_time": null,
     "email_cc": [
     ],
     "status": {
     "in_progress": true,
     "internal_name": "Open",
     "stop_timer": false,
     "color": "#0066ff",
     "name": "Open",
     "id": "317XXXXXXXXXX657"
     },
     "template": {
     "name": "Default Request",
     "id": "317XXXXXXXXXX655"
     },
     "email_ids_to_notify": [
     ],
     "attachments": [
     ],
     "request_type": null,
     "display_id": "1",
     "time_elapsed": "0",
     "notification_status": null,
     "description": null,
     "responded_time": null,
     "is_service_request": false,
     "urgency": null,
     "has_request_initiated_change": false,
     "department": null,
     "is_reopened": false,
     "has_draft": false,
     "has_attachments": false,
     "has_linked_requests": false,
     "is_overdue": false,
     "technician": null,
     "has_problem": false,
     "due_by_time": null,
     "is_fcr": false,
     "has_project": false,
     "site": null,
     "is_first_response_overdue": false,
     "completed_time": null,
     "email_bcc": [
     ],
     "category": {
     "deleted": false,
     "name": "Operating System",
     "id": "317XXXXXXXXXX705"
     }
     },
     "response_status": {
     "status_code": 2000,
     "status": "success"
     }
     }
   

To fetch the ID of the newly created record from the success response obtained, execute the following snippet:

 info <response_variable>.get("request").get("id");
   

Failure Response

  • The failure response for incorrect or non-existent record ID will be returned in the following format:
     {
     "response_status": {
     "status_code": 4000,
     "messages": [
     {
     "status_code": 4007,
     "type": "failed",
     "message": "Invalid URL accessed"
     }
     ],
     "status": "failed"
     }
     }
  • The failure response for incorrect or non-existent field API name will be returned in the following format:
     {
     "response_status": {
     "messages": [
     {
     "status_code": 4001,
     "type": "failed",
     "message": "EXTRA_KEY_FOUND_IN_JSON"
     }
     ],
     "status": "failed"
     }
     }
  • The failure response for invalid values against the field API names will be returned in the following format:
     {
     "response_status": {
     "status_code": 4000,
     "messages": [
     {
     "status_code": 4001,
     "field": "subcategory",
     "type": "failed"
     }
     ],
     "status": "failed"
     }
     }

Related Links

Get Started Now

Execute