Code of PUT Scripted rest API

NikitaGupta02
Tera Contributor

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

7 REPLIES 7

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.

 

NikitaGupta02
Tera Contributor

Hello Viraj,

 

Thankyou for responding, Can we use insert function in PUT method?

 

 

Ankur Bawiskar
Tera Patron
Tera Patron

@NikitaGupta02 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader