Capture table schema in Update set

dinesh91n
Tera Expert

Hi All,

I missed to capture the table schema in update set while creating the table. Now am trying to capture the table data in new update set. But, when i am trying to move the update set to other instance. The table label is changing as "LABEL". Please see the image. So the table is not create properly. Please advice.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Dinesh,



Try this... (in dev)



Create a new local update set.



Use the application navigator filter to go to sys_update_xml.list



find_real_file.png



See if you can find the sys_dictionary entry for your table label using the various filters. If says anything other than "Default" in the Update Set column, leave it alone. If it is blank or says Default, change the record to point to your update set.



You can now mark your new update set Complete and promote it as any other.



If the record is associated with any other update set as noted above, then you will need to go to the sys_dictionary table, locate your table label and export the XML from dev and manually import it in to test & prod.



Exporting and Importing XML Files - ServiceNow Wiki


View solution in original post

6 REPLIES 6

You are welcome. I'm glad you got your question answered. Thank you for participating in the community.


kevinanderson
Giga Guru

I used the following script to recapture a custom table

 

// 1. create an update set and set it to current
// 2 run this background script
var my_custom_table_name = 'u_abc123'; // change this
var um = new GlideUpdateManager2();
var gr1 = new GlideRecord('sys_dictionary')
// dictionary entries for last 30 days related to custom table
gr1.addEncodedQuery("sys_created_onONLast 30 days@javascript:gs.beginningOfLast30Days()@javascript:gs.endOfLast30Days()^name="+my_custom_table_name)
gr1.query()

while(gr1.next()){
  um.saveRecord(gr1);
}

// choice options
gr1 = new GlideRecord('sys_choice')

gr1.addEncodedQuery("sys_created_onONLast 30 days@javascript:gs.beginningOfLast30Days()@javascript:gs.endOfLast30Days()^name="+my_custom_table_name)
gr1.query()

while(gr1.next()){
  um.saveRecord(gr1);
}