insertMultiple
Summarize
Summary of insertMultiple
TheinsertMultiplefunction in ServiceNow enables the creation of multiple new records in a specified table through a single operation. This is particularly useful for batch processing, allowing for efficient data entry.
Show less
Key Features
- The function accepts one or more record tags, each containing fields from the targeted table, excluding system fields.
- There is a limit of 200 records per operation, which can be gradually increased if performance permits.
- Responses include details based on the type of insert method:
- Regular: Returns sysid and display values.
- Import Set: Returns sysid, transformed target table names, display values, and an optional status message if there are errors.
- Import Set with Multiple Transforms: Provides multiple responses indicating the transform maps used.
Key Outcomes
Using insertMultiple, ServiceNow customers can efficiently insert multiple records, streamline data management processes, and receive detailed error messages for any issues encountered during the insert operation. This enhances data integrity and operational efficiency across their ServiceNow instance.
Creates multiple new records for the table targeted in the URL.
Input fields
The insertMultiple element may contain 1 or more record tags that contains all fields from the targeted table, excluding system fields. Limit the number of records inserted in a single operation to no more than 200. You can gradually increase this number with subsequent exports if the increase does not negatively impact instance performance.
Output fields
The insertMultipleResponse tag is followed by 1 or more record tags that contains:
| Table type | Output fields |
|---|---|
| Regular | The sys_id field and the display value of the target table (table) are returned. |
| Import set | The sys_id of the import set row, the name of the transformed target table ( There can be an optional status_message field or an error_message field value when When an insert did not cause a target row to be transformed (skipped because a key value is not specified), the sys_id field will contain the sys_id of the import set row, rather than the targeted transform table. |
| Import set with multiple transforms | The response from this type of insert will contain multiple sets of fields from the regular import set table insert wrapped in a multiInsertResponse parent element. Each set will contain a
map field, showing which transform map created the response. |
Sample SOAP messages for a regular table
The following example shows an insert that specifies the short description only:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inc="http://www.service-now.com/incident">
<soapenv:Header/>
<soapenv:Body>
<inc:insertMultiple>
<record>
<short_description>this is test 1</short_description>
</record>
<record>
<short_description>this is test 2</short_description>
</record>
<record>
<short_description>this is test 3</short_description>
</record>
</inc:insertMultiple>
</soapenv:Body>
</soapenv:Envelope>The resulting response looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inc="http://www.service-now.com/incident">
<soapenv:Header/>
<soapenv:Body>
<insertMultipleResponse>
<insertResponse>
<sys_id>168160ad4a36231200a89091281dc803</sys_id>
<number>INC0055180</number>
</insertResponse>
<insertResponse>
<sys_id>1681622e4a36231200a8909115e5c388</sys_id>
<number>INC0055181</number>
</insertResponse>
<insertResponse>
<sys_id>1681626e4a36231200a89091fa3c0aa8</sys_id>
<number>INC0055182</number>
</insertResponse>
</insertMultipleResponse>
</soapenv:Body>
</soapenv:Envelope>Sample SOAP messages for an import set table
The following example shows an insert that specifies the short description only:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:imp="http://www.service-now.com/imp_notification">
<soapenv:Header/>
<soapenv:Body>
<imp:insertMultiple>:-->
<imp:record>
<imp:message>one</imp:message>
<imp:uuid>a</imp:uuid>
</imp:record>
<imp:record>
<imp:message>two</imp:message>
<imp:uuid>b</imp:uuid>
</imp:record>
<imp:record>
<imp:message>three</imp:message>
<imp:uuid>c</imp:uuid>
</imp:record>
</imp:insertMultiple>
</soapenv:Body>
</soapenv:Envelope>The resulting response looks like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:imp="http://www.service-now.com/imp_notification">
<soapenv:Header/>
<soapenv:Body>
<insertMultipleResponse>
<insertResponse>
<sys_id>1296b3ab0a0a0b5b73e966fbfab7acde</sys_id>
<table>incident</table>
<display_name>number</display_name>
<display_value>INC0010033</display_value>
<status>ignored</status>
<status_message>No field values changed</status_message>
</insertResponse>
<insertResponse>
<sys_id>1296b48e0a0a0b5b62513bb5974a7d96</sys_id>
<table>incident</table>
<display_name>number</display_name>
<display_value>INC0010034</display_value>
<status>ignored</status>
<status_message>No field values changed</status_message>
</insertResponse>
<insertResponse>
<sys_id>1296b58b0a0a0b5b468f534659538b9a</sys_id>
<table>incident</table>
<display_name>number</display_name>
<display_value>INC0010035</display_value>
<status>ignored</status>
<status_message>No field values changed</status_message>
</insertResponse>
</insertMultipleResponse>
</soapenv:Body>
</soapenv:Envelope>