Copy the response body of the import set api to new table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 05:52 AM
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 ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-15-2024 11:15 PM
1 create a rest Message.
2. call rest message any server script and apply logic to response body insert in the table
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 05:26 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 06:38 AM
I have tried PDI it's working fine.
Thanks
dgarad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 09:57 AM - edited ‎05-16-2024 09:59 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2024 10:25 PM
yes it's possible
Thanks
dgarad