How is your experience with the OutSystems Community?
27
Views
4
Comments
Service now
Question

Hi All,

I want to integrate with service now application from odc to create the ticket having message as old value ,new value which are updating in the form,the field with old value nd new value,

Please let me know the approach how to send the values field,old value and new value in payload.

Also please let me know if service now provides rest api for creating ticket in service now as in other application it's using soap.

Regards


2026-06-20 17-43-43
Sherif El-Habibi
Champion

Hello @Preeti zade,

I'm not entirely sure if I understood your question correctly, but if you're asking whether ServiceNow provides REST APIs, then yes, it does.

I found the these references that might help:

  • https://www.servicenow.com/docs/r/api-reference/rest-apis/c_TableAPI.html
  • https://developer.servicenow.com/dev.do#!/reference/api/australia/rest/c_TableAPI
UserImage.jpg
ujwala T

Thank you,

Want to pass only the updated values as old value and new value so not sure if the api supports,

In that case only soap to be used?

And please let me know the approach to send only the updated values in soap msg as not sure if rest api supports as in documentation update record api wrt id from table in service now but want to pass from the form  the message description as old values nd new values and field name for each field. 

2023-12-26 10-35-28
OutSystems Neo
Staff
AI Generated

You can do this in ODC with a REST integration; SOAP isn’t available in ODC right now. No SOAP in ODC

Below is a practical approach tailored to ServiceNow and to your “old value / new value” requirement.


1. Check ServiceNow’s REST API for ticket creation

ServiceNow does provide REST APIs for creating incidents (tickets). Typically it’s the Table API or Incident API, with an endpoint like:

POST https://<your-instance>.service-now.com/api/now/table/incident

Your ServiceNow admin can confirm:

  • The correct instance URL
  • The table (incident / custom table)
  • Fields to send in the payload
  • Authentication method (Basic/OAuth/etc.)

2. Decide the payload structure for old/new values

You have a few common options for how to send old/new values:

  1. Single “description” or “comments” field
    Build a text that contains all changes, for example:

    • Field: Priority | Old: Low | New: High
    • Field: Status | Old: Open | New: Closed
  2. Dedicated custom JSON field (if ServiceNow has a custom field to store raw JSON)
    Example:

    {
      "changedFields": [
        { "fieldName": "Priority", "oldValue": "Low", "newValue": "High" },
        { "fieldName": "Status", "oldValue": "Open", "newValue": "Closed" }
      ]
    }
    
  3. Separate columns (one column per “old” and “new” value)
    Only if your ServiceNow table has individual columns like u_old_priority, u_new_priority, etc.

Ask your ServiceNow team which approach is supported/preferred.


3. Prepare the REST integration in ODC

In ODC you’ll consume ServiceNow as a REST API:

  1. In ODC Studio, create a REST API integration and:

    • Use the ServiceNow endpoint URL.
    • If you have a Swagger/OpenAPI spec for ServiceNow, you can import it; otherwise, define a single method (POST) manually. Consuming a REST API
  2. Define:

    • Method: POST
    • Request body: typical ServiceNow incident fields (e.g., short_description, description, category, etc.)
    • Add extra fields to carry your old/new values if the ServiceNow side supports them (e.g., u_change_details).
  3. Configure Authentication in ODC Portal for that REST integration (Basic auth or custom headers via callback). Consuming a REST API


4. Build the “old vs new” data in your ODC logic

In your ODC app, when a user updates a form:

  1. Retrieve old values before the update (e.g., from your database).

  2. After the user submits, you have:

    • Old record (before update)
    • New record (submitted values)
  3. Construct a message or structure:

Example: build a description string

Create a text variable ChangeDescription:

"Field: Priority | Old: " + OldRecord.Priority + " | New: " + NewRecord.Priority + "\n" +
"Field: Status | Old: " + OldRecord.Status + " | New: " + NewRecord.Status

You can loop through fields if you have many, or just build manually for the important ones.

  1. Map this to the request body of the REST method:
  • short_description = "Ticket created from ODC"
  • description = ChangeDescription (the text with all field/old/new)
  • Any other fields required by ServiceNow.

If using a custom JSON field instead, create a Structure like:

ChangedField:
  - FieldName: Text
  - OldValue: Text
  - NewValue: Text

ChangePayload:
  - ChangedFields: List of ChangedField

Populate ChangedFields with each changed field and then serialize it to JSON (if ServiceNow expects raw JSON text) or map it directly if your REST body is defined with that structure.


5. Call the REST method and handle the response

In your Server Action:

  1. After successfully updating your local database record:
    • Call the generated REST method to ServiceNow.
    • Pass the built payload (description or JSON with changes).
  2. Check the response:
    • If success, you can store the ServiceNow ticket number back in your entity if needed.

ODC will log each REST call in the Monitor > Logs area of the ODC Portal, useful for debugging payloads and responses. Consuming a REST API


6. Authentication / headers (if required)

If ServiceNow needs tokens or custom headers beyond Basic Authentication:

  1. Configure Basic Authentication in ODC Portal if that’s enough. Consuming a REST API
  2. If you need to inject tokens or custom headers, use the REST API’s OnBeforeRequest callback:
    • Set Request.Headers (e.g., Authorization: Bearer <token>).
    • You can also log or transform the request there. Consuming a REST API

Summary

  • In ODC you must use REST, not SOAP, to connect to ServiceNow. No SOAP in ODC
  • Build the old/new value details in your server logic after comparing old and new records.
  • Map that information to either:
    • A description/comments field, or
    • A custom JSON/fields agreed with your ServiceNow team.
  • Use ODC’s REST integration (POST) to create the ticket and send the payload with those values. Consuming a REST API

If you describe how you want the ServiceNow payload (e.g., simple text vs structured JSON), I can outline the exact Structure and REST method definition in ODC terms.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2025-09-25 14-38-22
Lokesh Kumar Yadav

You can integrate with ServiceNow from ODC using REST APIs. ServiceNow provides REST APIs for ticket/incident creation, so SOAP is not mandatory and REST is the recommended approach.

To send old value, new value, and field name in the payload, first store the existing form values before update. After the form is updated, compare the old and new values field by field and prepare the payload dynamically. You can send the details in the description field of the ticket, for example: “Field: Status, Old Value: Pending, New Value: Approved”.

If multiple fields are updated, you can append all field changes in the same description message and send it through the REST API request. In ODC, create a POST REST API method and call the ServiceNow incident/table API endpoint with the required authentication (Basic Auth or OAuth). Once the payload is sent successfully, ServiceNow will create the ticket and return the incident number in the response.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.