Import Set REST API - JSON array only processes first record - Is this by design or limitation?

kakunurisat
Kilo Explorer

Hi Community,

We are building a high volume identity provisioning system that needs
to provision 100,000+ records to ServiceNow sys_user table.

We created an Import Set staging table (u_iam_user_import) with a
Transform Map to sys_user with Coalesce on user_name field.

PROBLEM:
When we POST a JSON array to the Import Set REST API, only the
FIRST record gets processed. All other records are ignored.

TEST:
POST /api/now/import/u_iam_user_import
Body:
[
{"u_user_name": "user001", "u_last_name": "Test001"},
{"u_user_name": "user002", "u_last_name": "Test002"},
{"u_user_name": "user003", "u_last_name": "Test003"}
]

RESULT:
- Only user001 created in sys_user
- user002 and user003 NOT created
- Response only returns 1 result

We also tried insertMultiple endpoint:
POST /api/now/import/u_iam_user_import/insertMultiple
Body: {"records": [...]}
Result: All records inserted into staging but all fields empty → skipped

QUESTIONS:
1. Is JSON array processing limited to first record by design?
2. Does this behave differently on production/enterprise instance vs PDI?
3. Is insertMultiple the correct bulk approach? Why are fields empty?
4. What is the RECOMMENDED approach to provision 100,000+ records
to sys_user via REST API in minimum time?
5. Is there a Batch API or any other approach for true bulk operations?

Instance: Personal Developer Instance (PDI)
Version: (check your version and add here)

Any help appreciated. Thank you!

1 REPLY 1

amila
ServiceNow Employee

InsertMultiple operation of the Import set API ( i.e  /api/now/import/u_iam_user_import/insertMultiple ) is the recommended approach for these operations. The reason you see column values are empty because insertMultiple by default expect column labels as the JSON key. But in the request, you use column names. This can be configured by going to System Web Service -> REST -> InsertMultiple. You can add a configuration as given in the attachment to map to column names.

 

Further if you are sending larger payload sizes, It is recommend to set  com.glide.import_set_api.insert_multiple_optimize system property to true to improve the performance of load time.

 

This is a core platform feature. It works same in any ServiceNow instance.