- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2018 12:58 PM
Hi,
I created a SOAP web service import set to import records from third party tool.
After sending the payload of the record to be created in ServiceNow, 3rd party tool expects a customized XML response. I built this custom XML response with a business rule on my target table and which is working fine.
But the issue is that ServiceNow is sending a default XML response which has the SYS_ID of the import set record. This is overriding my custom response on the 3rd party tool side.
My question(s):
Is it possible to restrict the OOB XML response? If not, How to modify that OOB XML response to send my custom fields in it.
Thanks
Rajesh
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2018 01:02 PM
You can add this in your transform map scripts for adding custom messages in your response.
if(source.email == ""){
response.custom_error = "Invalid email";
ignore = true;
}
This will return back a new node in your response: <custom_error>Invalid email</custom_error>
or you achieve this using scripted web service.
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2018 01:02 PM
You can add this in your transform map scripts for adding custom messages in your response.
if(source.email == ""){
response.custom_error = "Invalid email";
ignore = true;
}
This will return back a new node in your response: <custom_error>Invalid email</custom_error>
or you achieve this using scripted web service.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-11-2018 09:30 PM
Thank you very much Sachin!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2019 07:24 PM
In this case,
1. What does custom_error mean or where does it come from?
2. What does this do?
3. How to use response? (responseDOT) do we use any field name? which field name?
if(source.email == ""){
response.custom_error = "Invalid email"; // what does custom_error mean or where does it come from
ignore = true; //what does this do?
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2021 11:28 PM
custom_error is one of the JSON variable of response paylaod which is created by transform script.
Explaination of ignore=true; Refer from: https://docs.servicenow.com/bundle/rome-platform-administration/page/script/server-scripting/reference/r_TransformationScriptVariables.html
Variable name: ignore
Type: Boolean
Description: When set to true, skips or aborts the current import action. In onStart scripts, this variable aborts the entire transformation process. In onBefore scripts, this variable only skips the current row being transformed.