I want to save the record data as an XML file in the attachment TBL.

bonsai
Mega Sage

I would like to get a backup of record data.

I would like to periodically get an XML file of one week's worth of record data.

I would like to convert the records of the target table into XML files and save them in the attachment table.

Is it possible to do this with a script?

1 ACCEPTED SOLUTION

@bonsai 

Since you want backup of data, why not use archival?

I don't think any other way but you might have to use a custom solution to export the XML but you will have to copy that file somewhere within the instance.

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@bonsai 

you can use export set feature for this and setup mid server.

it will send push table data as XML to particular mid server location

Export sets 

Any other approach you will have to create a custom logic and solution to handle

AnkurBawiskar_0-1753108678250.png

 

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

Thank you for your answer.

However, I cannot use the mid server.

I would like to save the XML data in another way.

The XML data is intended to be imported later to recover the data.

@bonsai 

then there is no direct way to handle the export of XML of data.

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

Are there other ways to save records?
The reason I'm sticking to the XML format is because I want to preserve the sys_id.

I don't care about the XML format if I can save the records in another way and restore them with the same sys_id.