Could not update record through Rest API explorer .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2025 02:12 AM
Hi All,
I am getting 422 service error while using PUT method on Rest API explorer for incident table.
I have the below script in Scripted REST Resource table for the API definition. What should I make changes to get 200 success response to update the record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 08:24 PM - edited 03-25-2025 03:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 08:28 PM
Did you debug which IF part is being run when you consume the endpoint?
what does your sample JSON request look like?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 09:00 PM
One thing Ankur I want to know that will it update the existing value of a field of a existing record ?
In my case it is inserting new value for a field of a existing record but it is updating the previous value for the same record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 09:52 PM
sorry but you didn't share the complete details i.e. how the API request looks like etc
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 09:55 PM
Yes I debuged that the if part of the following part script is running when we consume the endpoint.