Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Wasif
Tera Guru
Tera Guru

For folks well-versed with platform's out-of-the-box API, Import Set API, they would know that this can be used in integrations where the implementation may require additional data manipulation using the Transform maps...

However, one important thing to note w.r.t. application calling this api and the response code replied from ServiceNow for the below particular scenario.

This API will reply a 200 response code if the record is successfully created in the Import table, despite failing in the transformation logic; this is an important use case as the calling application may assume all is well and the job got done, but in reality it failed in ServiceNow.

To work around this, the calling app not only needs to rely on the response code, but also the 'status' key in the response body and consider a success if the response code is 200 and there is no error in the response body.

1 Comment
Sreeram Nair
Tera Guru

If you need stronger guarantees, poll the corresponding import set run / transform execution (or use async callbacks) and fail your integration if the transform outcome isn’t successful.

To ensure the data was actually transformed and loaded, you should capture the import_set ID from the API response and poll the transform history tables — specifically sys_import_set_run and sys_import_set_row_error — using the Table API (e.g., GET /api/now/table/sys_import_set_run?set=<import_set_id>) to verify that the transform completed successfully and no row-level errors exist. This polling method, described in ServiceNow’s “Import Set API” documentation and the community article “Import Set API – Goodbye SRAPIs?”, provides stronger guarantees than relying solely on the HTTP response code. You can also make transformations synchronous (via the sys_rest_insert_multiple configuration) if your use case requires the integration to block until the transform finishes.

Refrences: https://www.servicenow.com/docs/bundle/zurich-api-reference/page/integrate/inbound-rest/concept/c_Im...
https://www.servicenow.com/community/developer-articles/import-set-api-goodbye-srapis/ta-p/2318624