Geoprocessing Task with Feature Set derived from Feature Layer not working

Discussion created by sr0bergman on Aug 10, 2013
Latest reply on Aug 11, 2013 by stevel
I have a simple geoprocessing service written in python that converts a table to a CSV file.  It works fine in ArcMap and I can get it to work in Javascript when the input data is set as a constant value or selected form the layer list.  When I try to run it with user defined input (a Feature Set derived from a Feature Layer) the tool fails.  I am at a complete loss! 

The service is published at:

Here is my code:

function exportAll(){
     var query = new esri.tasks.Query();
  query.where = "1 = 1";
  query.outFields = ["*"];
  //parcelsFS is my Feature Service Layer
  parcelsFS.queryFeatures(query, function (features) {
  var inputFeatures = new esri.tasks.FeatureSet();
        inputFeatures = features.features;
  var params= { "Table_Name":inputFeatures};
  gpTask.submitJob(params, completeCallback , statusCallback,function(error){

function completeCallback(jobInfo){
        if(jobInfo.jobStatus !== "esriJobFailed"){
          gpTask.getResultData(jobInfo.jobId,"Output_CSV", downloadFile);
      function statusCallback(jobInfo) {
        var status = jobInfo.jobStatus;
        if(status === "esriJobFailed"){
        else if (status === "esriJobSucceeded"){
      function downloadFile(outputFile){;
        var theurl = outputFile.value.url;
        window.location = theurl;