Null values are not updating in Integration

tonystark
Mega Expert

Hii Everyone,

        I am currently working on snow to snow Integration with SOAP and web services using business rules,the inserting and updating of incident is working successfully. But when I am trying to update incident with null values that was not updating in the other instance, instead the old values are remaining on the form.

Thanks,

Tony.

pradeepksharmactomasiramyathakkallapally

4 REPLIES 4

Midhun1
Giga Guru

Hi Tony,



FYI:



By default, ServiceNow does not omit empty elements, elements with NULL or NIL values, from SOAP messages.


To prevent SOAP responses from containing empty elements, an administrator can create a system property called glide.soap.omit_null_values and set the value to true. This behavior is compliant with the WSDL as all elements in a SOAP message have a minOccurs=0 attribute and are therefore optional. In addition, this behavior prevents the instance from creating inefficient SOAP messages containing a large number of empty elements.


Set this property to false to allow SOAP messages to search for existing fields with empty values. For example, if an administrator wants to search for incidents with an empty Assigned to field from a SOAP message, then the SOAP message must be able to send an empty value for this field.



SOAP Web Service - ServiceNow Wiki


Lsaydon
Tera Contributor

In integration from data source, in transform map you need to checked the checkbox: copy empty value, maybe in soap it is work like this. 

 

Lili saroussi

david_loo
Tera Contributor

Perspectium Replicator synchronizes multiple servicenow instances and databases as a native application and addresses the NULL value problem with a checkbox.



Replicator for ServiceNow — Relentless Data Synchronization - Perspectium



Cheers


David


Riya Verma
Kilo Sage
Kilo Sage

Hi @tonystark ,

 

Hope you are doing great.

 

we can investigate and implement a solution using business rules.

  1. Identify the Business Rule:

    • Locate the existing business rule responsible for updating incidents in the integration process. This business rule is triggered when an incident record is updated.
  2. Modify the Business Rule:

    • Within the business rule script, we need to handle the scenario where null values are provided for specific fields during an update.
    • Check if the field values are null and handle them appropriately by explicitly setting the field values to null or an empty string.

please find the code below for reference:

(function executeRule(current, previous /*null when async*/) {
   // Check if the incident is being updated
   if (current && previous) {
      // Check if the field values are null
      if (current.short_description === null) {
         current.short_description = ''; // Set the field value to an empty string
      }
      
      if (current.description === null) {
         current.description = ''; // Set the field value to an empty string
      }
      
      // Continue updating other fields...
   }
})(current, previous);


 

Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma