rest message return code '200'

soukayna
Tera Contributor

hello i need to create a record in a table in an instance using a rest message in an other instance , but i got the code 200 wich is success

this is my post method:

find_real_file.png

and this is my table:

find_real_file.png

any idea pls ,

thanks

1 ACCEPTED SOLUTION

Hi Soukayna,



With one endpoint there is only one table associated so that won't be possible.


For inserting into different tables different endpoint will be there.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

View solution in original post

15 REPLIES 15

hey ankur i will do it a just have one more question ,


i nsert sone record in my table using the rest and i want to get the sys_id in of those record in my business rule to i cant insert it in another table , any idea


??


Hi Soukayna,



Can you explain in more details?



Regards


Ankur


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

sure,


well i need to add record in 2 tables using 2 rest messages , the first one works without any problems , but in the second i a field is a list of sys_id from my 1st table and my business rule is an other instance than the tables , so how can i after inserting in the first table get the sys_id of those record to i can make them in the second one ?


Hi Soukayna,



As far as I understood from your details, you are inserting record in table A via REST API.


Now you want to insert record in table B in same instance and while creating record in table B you need to populate the reference of the record just now created via REST API for table A.



If this is correct understanding then have business rule after insert on Table A and create record in table B via script and populating the current.sys_id in the table B field which refers to table A.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

hi ankur,


i have a table A in my instance1 wich i use a business rule in it to call the api message to insert some of fields from this table A in a table B in instance 2 and other fields from table A and   a list of records from the table B   in a table C which is in instance 2 .


i want to get sys_id of element just inserted in table B to populate a list in table C (they are in the same instance)


hope i m clear ?