jason_ballweg
Nintex Newbie

External List lookup - Scraping Data and returning to workflow issue

I currently have a form set up where a manager can input their employee ID, it returns a list of their direct reports. 

The return list has a built in checkbox, i would like to return the state of the checkbox and the employee ID of the direct report to the workflow on form submission. 

My code is using a jQuery foreach loop to parse the returned table for the checkbox state and employee ID. I'm not having any problem with the checkbox at all, but the employee ID is returning an array with each index is the complete list of employee IDs x# of times (where x is the number of employees returned in the initial search). 

Any idea what I'm doing wrong?

 

Here is the code im currently using 

 

function Getresults(){
var SSO = "";
var chbx = "";
var SSO_arr = [];
var chbx_arr = [];

NWF$(".ms-vb-title").each(function () {
if ( $( this ).hasClass( "ms-vb-title" ) ) {
SSO = $(".ms-vb-title").text();
}
SSO_arr.push(SSO);
});

NWF$(".s4-itm-cbx").each(function () {
if($(this).prop("checked")){
chbx = True;
}else{
chbx = False;
}
chbx_arr.push(chbx);

});

for(i = 0; i < chbx_arr.length; i ++){

console.log(chbx_arr[i] + SSO_arr[i]);
}

}

 

0 Kudos
Reply