Comments on: Enabling Related List Exports in ServiceNow https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 19:24:41 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Mark Stanger https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9629 Thu, 04 Feb 2016 23:46:22 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9629 In reply to John Stettin.

Thanks John!

]]>
By: John Stettin https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9628 Wed, 03 Feb 2016 21:00:05 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9628 I know this is an old post but figured since it helped me find this solution maybe this will help someone else. I had a need to export a defined related list to CSV. You could also just create an encoded query and poll any table dynamically. You can also just modify the function to accept a view param and pass the view value instead of using the view from the current form.

function doStuff() {
   var sysparm_table = "";
   var sysparm_sys_id = g_form.getValue('u_number');  
   var sysparm_query = "parent=" + sysparm_sys_id;

   //Define the related list table
   sysparm_table = 'my_related_table';
   runContextAction(sysparm_table, sysparm_query);
}

function runContextAction(sysparm_table, sysparm_query) {
  //Obtains the rows number of the current report
  var sysparm_rows1 =$$('.list_row_number_input span')[1].innerHTML;

  //Parses string value into an integer value
  var num_rows = parseInt(sysparm_rows1);

  //Get view name needed to export
  var sysparm_view =gel('sysparm_view').value;

  //Creates export file if rows is less than limit value
  if (num_rows < g_export_warn_threshold) {
     var dialog = new GwtPollDialog(sysparm_table, sysparm_query, sysparm_rows1, sysparm_view, "unload_excel");
     dialog.execute();
     return;
  }
  var dialog = new GwtExportScheduleDialog(gel("sysparm_table").value, sysparm_query, sysparm_rows1, sysparm_view, "unload_excel");
  dialog.execute();
  return;
}
]]>
By: Matt https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9627 Wed, 12 Nov 2014 16:57:40 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9627 I am also seeing the same issue as Anon. The export appears to be using the personalized columns for the table and not the set personalized for the related list.

Other than that, this is very useful functionality.

]]>
By: Anon https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9626 Fri, 03 Oct 2014 17:45:53 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9626 I noticed that if you export to excel it seems to use the columns specified by the system, and not the columns you may have personalized via gear icon.

]]>
By: Robert Fedoruk https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9625 Tue, 12 Aug 2014 18:34:42 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9625 Not to mention that “open new window” will subvert the context of your main window the next time you refresh.

]]>
By: Mark Stanger https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9624 Thu, 24 Jul 2014 13:20:05 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9624 In reply to kalai.

While it’s true that you can right-click a breadcrumb and open it in a new window, this method is nice because it’s more consistent and intuitive for all users of the system.

]]>
By: kalai https://servicenowguru.com/system-ui/enabling-related-list-exports-servicenow/#comment-9623 Thu, 24 Jul 2014 08:32:21 +0000 https://servicenowguru.wpengine.com/?p=5321#comment-9623 this is good. but have question though ..
why to create a new one, when we can open the related list in a new window using ‘open new window’ option and export it ?

]]>