AnsweredAssumed Answered

Querying a table does not return all fields

Question asked by kschultz@bgohio.org on Oct 16, 2018
Latest reply on Oct 16, 2018 by ESoekianto-esristaff
               ServiceFeatureTable {
                           id: workLogTable
                           url: ""
                           credential: Credential {
                               username: ''
                               password: ''
                           }
                           onQueryFeaturesResultsChanged: {
                       
                               if (queryFeaturesStatus === Enums.TaskStatusCompleted) {
                                   if (!queryFeaturesResult.iterator.hasNext) {
                                       return;
                                   }
                                 
                                   workLog.clearSelection();
                                   var features = []
                                   while (queryFeaturesResult.iterator.hasNext) {
                                       features.push(queryFeaturesResult.iterator.next());
                                   }
                                   workLog.selectFeatures(features);
                                   var identifiedObjects =[]
                                   var elem = features[0];
                                   identifiedObjects.push(elem);
                                   displayAttributesModel.append(elem);
                                   for (z = 0; z < displayAttributesModel.rowCount(); z++) {
                                       console.log(JSON.stringify(displayAttributesModel.get(z).attributes.attributeNames))
                                   }
                            }
                           }
}

I have this code that is being invoked
        params.whereClause = "GlobalID = '" + activeID+"'" ;
        workLogTable.queryFeatures(params);

I have all these fields
  • OBJECTID ( type: esriFieldTypeOID , alias: OBJECTID , editable: false , nullable: false )
  • CREW_RESPONDING ( type: esriFieldTypeString , alias: CREW , editable: true , nullable: true , length: 1073741822 )
  • WORK_SUMMARY ( type: esriFieldTypeString , alias: WORK_SUMMARY , editable: true , nullable: true , length: 1073741822 )
  • WORK_DETAILS ( type: esriFieldTypeString , alias: WORK_DETAILS , editable: true , nullable: true , length: 1073741822 )
  • HOURS ( type: esriFieldTypeDouble , alias: HOURS , editable: true , nullable: true )
  • MATERIALS_USED ( type: esriFieldTypeString , alias: MATERIALS_USED , editable: true , nullable: true , length: 1073741822 )
  • EQUIPMENT_USED ( type: esriFieldTypeString , alias: EQUIPMENT_USED , editable: true , nullable: true , length: 1073741822 )
  • BOIL_ADVISORY ( type: esriFieldTypeString , alias: BOIL_ADVISORY , editable: true , nullable: true , length: 75 )
  • ACCIDENT ( type: esriFieldTypeString , alias: ACCIDENT , editable: true , nullable: true , length: 75 )
  • LAW ( type: esriFieldTypeString , alias: LAW , editable: true , nullable: true , length: 75 )
  • WORK_TITLE ( type: esriFieldTypeString , alias: WORK_TITLE , editable: true , nullable: true , length: 75 )
  • CREW_ADDITIONAL ( type: esriFieldTypeString , alias: ADDITIONAL , editable: true , nullable: true , length: 1073741822 )
  • CREATED_BY ( type: esriFieldTypeString , alias: DATA_ENTRY , editable: true , nullable: true , length: 75 )
  • GlobalID ( type: esriFieldTypeGlobalID , alias: GlobalID , editable: false , nullable: false , length: 38 )
  • created_user ( type: esriFieldTypeString , alias: created_user , editable: false , nullable: true , length: 255 )
  • created_date ( type: esriFieldTypeDate , alias: created_date , editable: false , nullable: true , length: 36 )
  • last_edited_user ( type: esriFieldTypeString , alias: last_edited_user , editable: false , nullable: true , length: 255 )
  • last_edited_date ( type: esriFieldTypeDate , alias: last_edited_date , editable: false , nullable: true , length: 36 )
  • STATUS ( type: esriFieldTypeString , alias: STATUS , editable: true , nullable: true , length: 75 )
  • DEPARTMENT ( type: esriFieldTypeString , alias: DEPARTMENT , editable: true , nullable: true , length: 75 )
  • UPDATED_BY ( type: esriFieldTypeString , alias: UPDATED_BY , editable: true , nullable: true , length: 75 )
  • CLOSED_BY ( type: esriFieldTypeString , alias: CLOSED_BY , editable: true , nullable: true , length: 75 )

So the line 

console.log(JSON.stringify(displayAttributesModel.get(z).attributes.attributeNames))

is only outputting 

qml: {"0":"created_date","1":"created_user","2":"CREW_RESPONDING","3":"GlobalID","4":"last_edited_date","5":"last_edited_user","6":"OBJECTID"}

 

meaning the majority of my fields aren't being returned. So attribute values I need to display are not being displayed in my app.

 

Is this a known issue? Is there a way to solve it and return all fields?

Outcomes