2 Replies Latest reply on Jun 8, 2016 11:54 AM by jensenc221479

    CreateDataObject Not working

    jensenc221479

      I am trying to get two arrays to export to a single csv file. the code i wrote will only export one of them. i want each array to be on a separate row when opened in excel.

      var fieldValues = [];
      var fieldValuesNames = [];
      
      for (var i = 0; i < this.numFields; i++)
      {
        fieldValues.push(this.getField(this.getNthFieldName(i)).value);
        var f = this.getField(this.getNthFieldName(i));
        fieldValuesNames.push(f.name);  
      }
      
      
      
        
      this.createDataObject('output.csv',fieldValuesNames.join(),fieldValues.join());
      this.exportDataObject({ cName:'output.csv', nLaunch:'2'});
      

      like i said the code exports fieldValuesNames to the file, but the second array is not exported.

      thanks for any help i get.