- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 01:40 AM
Hi All,
I am working on a Webservice(Import Set API), Customer want 'status' field to be be customized based on the fields update. Can we modify the 'status' in the response body?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 02:32 AM
Hi,
not possible. the status you highlighted is as per the status field on the import set table and is OOB and cannot be customized.
you can set custom response and add a json key value if required using the response variable in onAfter transform script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 01:43 AM
Hi,
It is not possible if you are working on the Import set API.
If you want to set the custom messages then need to build Scripted REST API.
Refer this link to set custom response messages and status code.
https://community.servicenow.com/community?id=community_article&sys_id=59a7b3fa1bc1995086b3ece6b04bcb1f
Hope it helps!!
Please Mark ✅ Correct if applicable, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 02:06 AM
Hi Ankita,
Looks like we can't modify the status attribute but there are a couple of workarounds you can do -
1. Set a custom attribute to the status you want to set and ask the customer to refer to this custom attribute. Import set APIs to allow custom responses but to limited fields - details are here
2. Create a scripted web service, ask the customer to call this scripted web service and in turn in this scripted web service you call the import set API and customize the response output the way you want to send it to the customer endpoint.
Hope this helps.
Thanks
-Harneet Sital
Request you to please mark my answer as helpful or correct based on the impact
Find all my ServiceNow articles here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 02:32 AM
Hi,
not possible. the status you highlighted is as per the status field on the import set table and is OOB and cannot be customized.
you can set custom response and add a json key value if required using the response variable in onAfter transform script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader