Export to XML form script not woring

Abdul Musavvir
Kilo Guru

Hi Everyone

 

I'm trying to export list of records in XML, it is not working, showing the XML text in new tab.

However when I export in CSV, its working perfectly fine.

 

var url = 'sys_ui_bookmark_list.do?XML&sysparm_query=user=' + current.sys_id;
action.setRedirectURL(url);

 

Any Suggestions/comments?

 

Thanks in Advance

-Abdul Musavvir

Ankur Bawiskar
Tera Patron

@Abdul Musavvir 

which URL does it open?

ideally it should work fine.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

For XML it is showing like this instead of downloading the XML file

AbdulMusavvir_0-1734947639788.png

 

@Abdul Musavvir 

why not export from the list header Right click -> Export XML

You already have the records with your filter applied

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@Abdul Musavvir 

It didn't work for me as well for incident table. it opens up the URL, seems we need to right click and then save and it won't auto download XML

Seems platform issue or limitation when compared to other formats such as csv

If my response helped please mark it correct and close the thread so that it benefits future readers.

 

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