Attach the excel of 10,000 records to RITM when user select particular value in catalog item

UjwalaBedarkar
Tera Expert

Hi,

I have used below script in workflow to generate and add the attachment but its taking time to submit the request. is it due to 10,000 records? if so, how to avoid this?

var rm = new sn_ws.RESTMessageV2();
rm.setHttpMethod('GET');
 
// Construct the URL for querying the u_opco_model table with pagination
var url = gs.getProperty("glide.servlet.uri") +
    "u_opco_model_list.do?sysparm_view=null&EXCEL&sysparm_query=" +
    encodeURIComponent('u_product_modelISNOTEMPTY');
 
 
rm.setEndpoint(url);
rm.setBasicAuth(gs.getProperty('fdx.glide.admin.user.userid'), gs.getProperty('fdx.glide.admin.user.password'));
rm.saveResponseBodyAsAttachment(current.getTableName(), current.sys_id, "Product Model Report-" + current.number + ".xls");
 
var response = rm.execute();
 
 
 
current.approval = 'approved';
5 REPLIES 5

I'm not sure why'd you use a BR here? A BR would run at the table level, rather than for a unique individual process