We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Servicenow PDI to PDI Integration

Aditya02
Tera Guru

I have used GET and POST HTTP methods to integrate two PDI between. But I need to add  PATCH and DELETE Methods also for this PATCH method i dont want give sys id in Endpoint URL itself. Instead of that is there anyway to pass sys id. 

 

If i mentioned sys id in url itself then it will applicable only to one sys id 

i want to give dynamic sys id.

1 ACCEPTED SOLUTION

thullurishalini
Kilo Guru

Hi @Aditya02 

To use the PATCH method in ServiceNow without specifying the sys_id in the endpoint URL, you can pass the sys_id dynamically in the request body or as a query parameter. Here’s a summary of how you can achieve this:

  1. Using Request Body:

    • Include the sys_id in the JSON payload of your PATCH request.
    • Example:
      {
        "sys_id": "your_sys_id",
        "field_to_update": "new_value"
      }
      
  2. Using Query Parameters:

  3. ServiceNow Scripted REST API:

    • Create a Scripted REST API in ServiceNow to handle PATCH requests.
    • In your script, dynamically handle the sys_id from the request body or query parameters
      If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
      Sandeep
       

 

View solution in original post

5 REPLIES 5

Chetna_dev
Kilo Sage

You can use request parameters or request body to pass the sys ID. Here's how you can do it:

  1. Using Request Parameters:

    • Modify your endpoint URL to accept parameters.
    • Pass the sys ID as a parameter in your request.
    • Extract the sys ID from the request parameters in your PDI transformation and use it accordingly.

     

  2. Using Request Body:

    • Modify your request to include the sys ID in the request body.
    • Extract the sys ID from the request body in your PDI transformation and use it accordingly.

     

Sai Krishna6147
Mega Guru

Hi @Aditya02  ,

It may helps to you. please refer to this link

Refer:

ServiceNow to ServiceNow Integration - Step by Ste... - ServiceNow Community 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct 
Venkata Sai Krishna

thullurishalini
Kilo Guru

Hi @Aditya02 

To use the PATCH method in ServiceNow without specifying the sys_id in the endpoint URL, you can pass the sys_id dynamically in the request body or as a query parameter. Here’s a summary of how you can achieve this:

  1. Using Request Body:

    • Include the sys_id in the JSON payload of your PATCH request.
    • Example:
      {
        "sys_id": "your_sys_id",
        "field_to_update": "new_value"
      }
      
  2. Using Query Parameters:

  3. ServiceNow Scripted REST API:

    • Create a Scripted REST API in ServiceNow to handle PATCH requests.
    • In your script, dynamically handle the sys_id from the request body or query parameters
      If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
      Sandeep