insertMultiple
Summarize
Summary of insertMultiple
The insertMultiple function allows ServiceNow customers to create multiple new records in a specified table via a single operation. This feature is efficient for batch processing and can handle up to 200 records at once, with the option to increase this limit gradually based on performance considerations.
Show less
Key Features
- Input Fields: Accepts one or more record tags containing all relevant fields for the targeted table, omitting system fields.
- Output Fields: Returns information based on the success of the insert operation:
- Regular Table: Returns sysid and display value of the created records.
- Import Set: Provides sysid, transformed table name, display name, display value, and status (inserted, updated, or error) with optional messages for errors.
- Import Set with Multiple Transforms: Returns multiple sets of fields for each transform map involved.
Key Outcomes
ServiceNow customers can efficiently insert multiple records in one request, streamlining data entry processes and enhancing application performance. By leveraging this functionality, users can expect reduced manual input time and improved accuracy in record creation. Proper usage ensures that system performance remains optimal while meeting organizational data handling needs.
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>