How to copy data from one table to another

https://community.servicenow.com/community?id=community_question&sys_id=859a432ddb5cdbc01dcaf3231f961936


If you want to move records from a parent table to a child table, that should be relatively easy to do. Each table has a field by the name of "sys_class_name" which describes which table the record belongs to. For the records in the parent table, you just change the "sys_class_name" field from "change_request" to your new table name (eg. u_my_change_request).

If you wish to do this for all of the change_request records you have in that table, you simply do a GlideRecord script that queries all of the change_request records and sets the sys_class_name to the new name and updates the record.

This works in this scenario because you are moving records from a parent table to its child table, thus you know all of the field will exist in the destination table.



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章