function displayUpload() {
  var summaryData = [];
  var userData = array.users.filter(row => row.user.attributes.autoGenerate != "anonHero");
  for (i = 0; i < userData.length; i++) {
    var totalEvents = 0;
    for (j = 0; j < array.users[i].sessions.length; j++) {
      totalEvents += array.users[i].sessions[j].events.length;
    }
    var flag = (i < array.settings.numberHeroUsers) ? ' (Hero)' : '';
    var altId = (i < array.settings.numberHeroUsers && array.users[i].user.attributes.hasAnon == true) ? array.users[i].user.attributes.altId : '';
    summaryData.push({
      "User ID": (array.users[i].user.id === undefined) ? '' : array.users[i].user.id + flag,
      "Anon ID": (array.users[i].user.anonId === undefined) ? altId : array.users[i].user.anonId,
      "Featured Catalog Item":array.users[i].user.attributes.items[0].name,
      "# Sessions":array.users[i].sessions.length,
      "Total Events":totalEvents + array.users[i].sessions.length
    })
  }
  $('#upload-summary').html(dataTable(summaryData));
  array.summary = summaryData;
}
// Function to display summary of upload for review
Function to display summary of upload for review
Function to display summary of upload for review
function displayUpload() {
  var summaryData = [];
  var userData = array.users.filter(row => row.user.attributes.autoGenerate != "anonHero");
  for (i = 0; i < userData.length; i++) {
    var totalEvents = 0;
    for (j = 0; j < array.users[i].sessions.length; j++) {
      totalEvents += array.users[i].sessions[j].events.length;
    }
    var flag = (i < array.settings.numberHeroUsers) ? ' (Hero)' : '';
    var altId = (i < array.settings.numberHeroUsers && array.users[i].user.attributes.hasAnon == true) ? array.users[i].user.attributes.altId : '';
    summaryData.push({
      "User ID": (array.users[i].user.id === undefined) ? '' : array.users[i].user.id + flag,
      "Anon ID": (array.users[i].user.anonId === undefined) ? altId : array.users[i].user.anonId,
      "Featured Catalog Item":array.users[i].user.attributes.items[0].name,
      "# Sessions":array.users[i].sessions.length,
      "Total Events":totalEvents + array.users[i].sessions.length
    })
  }
  $('#upload-summary').html(dataTable(summaryData));
  array.summary = summaryData;
}
function displayUpload ( ) { var summaryData = [ ] ; var userData = array . users . filter ( row => row . user . attributes . autoGenerate != "anonHero" ) ; for ( i = 0 ; i < userData . length ; i ++ ) { var totalEvents = 0 ; for ( j = 0 ; j < array . users [ i ] . sessions . length ; j ++ ) { totalEvents += array . users [ i ] . sessions [ j ] . events . length ; } var flag = ( i < array . settings . numberHeroUsers ) ? ' (Hero)' : '' ; var altId = ( i < array . settings . numberHeroUsers && array . users [ i ] . user . attributes . hasAnon == true ) ? array . users [ i ] . user . attributes . altId : '' ; summaryData . push ( { "User ID" : ( array . users [ i ] . user . id === undefined ) ? '' : array . users [ i ] . user . id + flag , "Anon ID" : ( array . users [ i ] . user . anonId === undefined ) ? altId : array . users [ i ] . user . anonId , "Featured Catalog Item" : array . users [ i ] . user . attributes . items [ 0 ] . name , "# Sessions" : array . users [ i ] . sessions . length , "Total Events" : totalEvents + array . users [ i ] . sessions . length } ) } $ ( '#upload-summary' ) . html ( dataTable ( summaryData ) ) ; array . summary = summaryData ; }
Function to display summary of upload for review
Function to display summary of upload for review