Will Update work in the Insert Scripted Rest API

Ksnow
Tera Contributor

Hello all, @shloke04 @Ankur Bawiskar 

I have used scripted rest API (Insert), POST method to Insert the data, It worked fine.

There are few records inserted, all good here but later I have added 1 or 2 fields in that table and updated the scripted accordingly, just to update those 2 fields without disturbing the earlier records but the problem here is now records or inserting again as duplicates even though we have check point to stop duplicates.

Update function will not work in the Insert scripted rest API?

find_real_file.png

Please help!

Thanks,

Ksnow

17 REPLIES 17

Vishnu Prasad K
Giga Guru

Hi Ksnow,

 

POST method is always for creation, If you want to update the values on the newly added 2 columns, you should be using PUT.

And what restrictions you have setup, You can only do it in your instance before sending the payload. Once it is send, restrictions of the third party tool to which you are integrating applies

Hi @Vishnu Prasad K G 

Thanks for the response.

I have used POST method to update the field in another script and it worked fine for me.

I am not sure about which restrictions you're talking, could you please explain me in detail?

I am new to APIs stuff.

Thanks,

Ksnow 

 

@Vishnu Prasad K G 

This is not correct, you can still update records using the POST method itself. It all depends on how you are handling it within the logic written in your Scripted Rest API as far as I know.

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke