- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 05:22 AM
Below is my Glide record code, could you please tell me how can i create one array object and add all the sys id's of the records that is coming after adding quesry to that array object.
sendSbDataToApttus: function() {
try {
var sbRecord = [];
//var info = {};
// var response = {};
var sbReq = new GlideRecord('x_amex_sourcing_request_request');
sbReq.addEncodedQuery('x_amex_sr_ready_for_conga_push=true');
sbReq.query();
var recordCount = sbReq.getRowCount();
while (sbReq.next()) {
var sbRecJson = {};
sbRecJson.apttus_contract_id = sbReq.x_amex_sr_contract_id.toString();
sbRecJson.trm_emailId = sbReq.x_amex_sr_bu_trm_email_address.toString();
sbRecJson.bu_level1 = sbReq.x_amex_sr_business_unit_level_4.u_level_1.getDisplayValue().toString();
sbRecJson.bu_level2 = sbReq.x_amex_sr_business_unit_level_4.u_level_2.getDisplayValue().toString();
sbRecJson.bu_level3 = sbReq.x_amex_sr_business_unit_level_4.u_level_3.getDisplayValue().toString();
sbRecJson.bu_level4 = sbReq.x_amex_sr_business_unit_level_4.getDisplayValue().toString();
sbRecJson.countries_to = sbReq.x_amex_sr_location_of_services_to.getDisplayValue().toString();
sbRecJson.countries_from = sbReq.x_amex_sr_location_of_services_from.getDisplayValue().toString();
sbRecJson.tlm_Id = sbReq.x_amex_sr_associated_tlm_id.toString();
if(sbReq.x_amex_sr_pu_bank_impacting.toString().toLowerCase() == 'yes'){
sbRecJson.isUsBankImpacting = true;
}
else{
sbRecJson.isUsBankImpacting = false;
}
sbRecord.push(sbRecJson);
//To make ready_for_conga_push false after sending to Conga
sbReq.x_amex_sr_ready_for_conga_push = false;
sbReq.setWorkflow(false);
sbReq.autoSysFields(false);
sbReq.update();
}
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 05:30 AM
Hi Vikas,
To push all sys_ids in one array you need to write this
arr.push(gr.sys_id + "");
use "" to append all sys_ids together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 05:30 AM
Hi Vikas,
To push all sys_ids in one array you need to write this
arr.push(gr.sys_id + "");
use "" to append all sys_ids together.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-25-2022 05:40 AM
Hi,
what's your business requirement?
Your script looks fine.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader