Code of PUT Scripted rest API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 11:08 PM
Hello team,
I need to create the update the record via put scripted rest AP. Can anyone help me in this like how can we write the script for this and what will be the endpoint and payload for this?
Best Regards,
Nikita

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2025 04:04 PM
Viraj,
I see all the right values being set in the code. The field names are correct. It just seems like the setValue() function is not working. I wrote some more static code that doesn't loop through the payload and did a static field=value type call and then update and that worked fine. So I know my fields are correct. Just not sure why gr.setValue(field, requestBody[field]) isn't working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 11:28 PM
Hello Viraj,
Thankyou for responding, Can we use insert function in PUT method?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 12:37 AM
what's your business requirement here?
What did you start with and where are you stuck?
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