Update Requests in ServiceDesk

Table of ContentsDown

Overview

The update SDPOD integration task in Zoho Creator can be used to update an existing request in ServiceDesk Plus OnDemand. For example, in the request to book a conference hall, you can update the start time of the conference, the count of attendees etc. based on your requirement. The existing request in ServiceDesk Plus OnDemand gets updated based on the given values. The update request task is initiated in Zoho Creator by adding code to a form, which upon submission, updates the request in ServiceDesk Plus OnDemand.

Syntax

<response> = zoho.sdpod.update(moduleName,requestID, params);

where,
<response> is the map variable returned as response. It contains the details of the updates to be made in the request.
<moduleName> refers to the module in ServiceDesk Plus OnDemand. As of now Request is the only supported Module.
<requestID> is the ID of the Request that needs to be updated
<params> is the map variable that holds the key,value pairs. The map key is the label name as specified in the ServiceDesk Plus OnDemand Requests module and the map value is the field value as submitted in the ZC form.

Example - Using script-builder

In this example, an existing request is updated with new values. Lets assume we have a request to book a conference hall. Now the host needs to update the start time of the conference and the count of attendees. Using script-builder we will create the equivalent script. Upon submission of the form, the code gets executed and the request in ServiceDesk Plus OnDemand gets updated based on the given record ID.

  1. Go to the Zoho Creator form containing the request values
  2. Click on Workflow to open the scriptbuilder. Go to the On Edit - On Success section.
  3. Drag-and-drop the "call function" task under "Miscellaneous" tasks in Zoho Creator to select the request values.
  4. Select Integration tasks.
  5. Set "Select Service" as SDPOnDemand.
  6. Set "Select Function" as Update.
  7. Set "Module Name" as Requests.
  8. Set "ID" of the record that needs to be edited.
  9. Click on "New Map" to add the updated key-value pairs.
  10. Select the following key-value pairs and click on Done.
    "STARTTIME" : StartTime, "ATTENDEESCOUNT": Count
  11. Click on Done to insert the call function task.

Upon submission of the form, the request in ServiceDesk Plus OnDemand gets updated with the selected values

Example - Using free-flow scripting

Instead of using the script-builder you can also use the free-flow scripting to directly insert the code in the editor box.

  1. Go to the Zoho Creator form containing the request values
  2. Click on Workflow to open the scriptbuilder. Go to the On Edit - On Success section and navigate to Free-flow Scripting.
  3. Now add the following code in the editor box and click on "Save"

    // declare the map variable to hold key-value pairs
    params = {"STARTTIME" : input.StartTime, "ATTENDEESCOUNT": input.Count};

    // update request by executing the syntax
    response = zoho.sdpod.update("Requests", 1000, params);

    where,
    params contains the key-value pairs. The keys refer to the label names in ServiceDesk Plus OnDemand and the values refer to the values of Zoho Creator field values. For example, "STARTTIME" is the label name in ServiceDesk and input.StartTime is the value entered in the "StartTime" field of ZC form.
    response is the map variable returned as response. It contains the request update details.

    Requestsstands for the module name in ServiceDesk Plus OnDemand. As of now, Requests is the only supported module.

  4. 1000 stands for the ID of the request that needs to be updated. Replace it with the actual ID of the record that needs to be updated.
  5. Upon submission of the form, the request in ServiceDesk Plus OnDemand gets updated with the given request values.
  6. In this example, successful execution of the syntax will yield the following response:
    response = {"status": "Success", "STARTTIME" : "10:00:00", "ATTENDEESCOUNT": "20"}
  7. If for some reason, the execution fails, the response will be of the following format:
    response = {"status" : "Failure" , "message" : "<error message>"};

Share this post : FacebookTwitter