The CreatorCon Call for Content is officially open! Get started here.

Copy the response body of the import set api to new table

Prakash Pareek
Tera Expert

Hi , Could you please tell how can i copy the response body (which we will get when we hit the import set api) to another table .

ex: { "import_set": "ISET29325654",

"staging_table": "ABC",

"result": [

{ "transform_map": "ABC Transform Map",

"table": "sc_task",

"display_name": "number",

"display_value": "SCTASK0815512",

"record_link": "https://ABC/api/now/table/sc_task/93a4a9999bc6c610f41811b5bb4bcbb0",

"status": "error",

"sys_id": "93a4a9999bc6c610f41811b5bb4bcbb0",

"status_message": "Ignored: System could not find the Catalog Task: SCTASK0815512 in ServiceNow", "error_message": "This catalog task may not belong to catalog item. Please provide a valid catalog task" }

]

}

This is the response (and this response is different each time AND depends upon the sctask number ) .. now i want this response to be saved in another table's particular field .. Kindly please help me !!! Thank you ...

9 REPLIES 9

1 create a rest Message.

2. call rest message any server script and apply logic to response body insert in the table 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Hi @dgarad Thanks for reply ... While creating rest message basically the issue is base api url ... becuase if we select staging table also in rest message the url is different like api/now/ABC instead of api/now/import/ABC .. So this is the issue that is why i am not able to  create a rest message

Hi @Prakash Pareek 

 I have tried  PDI it's working fine.

 

dgarad_0-1715866686819.png

 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Hi @dgarad one silly question ... actually the situation is some other app [ex: ABC app] hits servicenow and i have created an transform map and import set table ... Now when i hit servicenow through postman [for just checking of api] i get the response as on top that i mentioned at start of our conversation . I want the response that i got in postman to be placed my servicenow instance some other table [ex: demoprakash table that in present in my servicenow instance]. Is it possible ????

 

 

So now if i use the rest message which is an outbound message can i get the response that i got when i hit the api from postman to my servicenow instance ... As rest message is a n outbound is it possible ??? Thank you

yes it's possible 

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad