Conditional transform maps for Import set API

sreedharkaliset
Mega Expert

Hi All,

I am trying to build an inbound web service(Import set API) which accepts a payload for CI table. Based on the sys class name given in the payload, it should insert the corresponding CI record.

I did create an inbound web service and mapped the Class attribute of cmdb_ci to the sys class name from the payload and the record is getting created.

Issue occurs where I send values specific to rack or any child table of cmdb_ci in payload. As the transform map is for cmdb_ci, all the fields on childs of cmdb_ci are not accessible in the transform map.

I was trying to check in community and docs if I could create multiple transform maps under same inbound web service and make them run based on conditions but I could not find any. If I give two transform maps under the web service, each map is creating one record which is not expected

Please suggest on how to overcome this.

Regards,

Sreedhar

6 REPLIES 6

Hi sreedharkalisetty,



Did you get the answer for your question ?.



Thank you,


Satish


As far as I know, you cannot, at least not with a simple web service and transform maps.

If you have multiple transform maps, the data sent to the staging table will still go through the multiple TMs and will return the results back to the sender for each TM that you have under the same web service.

 

If you need more complex solutions, you may want to look at a custom web service called Scripted REST API: https://docs.servicenow.com/en-US/bundle/tokyo-application-development/page/integrate/custom-web-ser...

This allows you to capture the inbound payload and process it however you like. You can even trigger multiple tranform maps from multiple resources and have them return different HTTP statuses and status/error messages etc.