The CreatorCon Call for Content is officially open! Get started here.

How to export embedded table with current data to excel?

Nana5
Mega Guru

Hio expert need to the embedded table export to excel with current data.Please help me out to achive this.

Table:

find_real_file.png

Thanks

1 ACCEPTED SOLUTION

Nana5
Mega Guru

HI ALL,



I got the solution now its working fine.



runContextAction();


function runContextAction() {



  var sysparm_rows = g_list.grandTotalRows;


  var num_rows = parseInt(sysparm_rows);


  var sysparm_query = 'u_parent_request=' + g_form.getUniqueValue();


  var tableName = 'u_single_or_multiple_invoice_request';



  var sysparm_view = g_list.view;


  if (num_rows < g_export_warn_threshold) {


  var dialog = new GwtPollDialog(tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel_xls');


  dialog.execute();


  return;


  }


  var dialog = new GwtExportScheduleDialog(tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel_xls');


  dialog.execute();


}



Regards,


Prakash Ranjan


View solution in original post

6 REPLIES 6

Dave Smith1
ServiceNow Employee
ServiceNow Employee

If you click on a table heading menu, is there an "export" function there?



Also - why export data from the platform OUT into Excel?


Hi Dave,


  There is no export but i have added there context menu, but thing is that its export the orld data as well but i nedd current data of the table which is displying.



NB: AS per requirment need to export the data.



Thanks


Hi Shishir,


  I belive you didn't get my requirment.


  I have created the context menu for the embaded table as below to exoport the data but its exporting all the data to excel but i need to export current data which is displaying in embedded table.



context menu.:


var sysparm_rows = g_list.totalRows;



  var num_rows = parseInt(sysparm_rows);


  var sysparm_query = g_list.getQuery({orderby: true, fixed: true});



  var sysparm_view = g_list.view;


  if (num_rows < g_export_warn_threshold) {


  var dialog = new GwtPollDialog(g_list.tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel');


  dialog.execute();


  return;


  }


  var dialog1 = new GwtExportScheduleDialog(g_list.tableName, sysparm_query, sysparm_rows, sysparm_view, 'unload_excel');


  dialog1.execute();



find_real_file.png


but this export exporting all the data which is avilable in single or multiple table but i need to to export only displayed data which is currently displaying on the table.



Thanks