AnsweredAssumed Answered

Qt and Tables in a Feature Service

Question asked by GozChris on Apr 15, 2015
Latest reply on Apr 22, 2015 by GozChris

I have a feature service that is hosted on ArcGIS.com, and the service contains a feature layer and a plain table. I want to update an attribute in the table from my Qt application, but I cannot. I do catch the signal onApplyFeatureEditsStatusChanged() and the status is indeed Enums.ApplyEditsStatusErrored, but I don't understand how to handle the actual error object: applyFeatureEditsErrors. That is,  applyFeatureEditsErrors.error is undefined.

 

The things that I CAN do:

- query the table, and loop through the results logging all the attribute values,

- update attributes in the table using the REST interface in a browser.

 

 

 

To check my code, I used the feature layer endpoint instead, created a feature layer from it, and added it to the map:

 

GeodatabaseFeatureServiceTable {
    
id: myTableFromURL
     url:someFeatureServiceRESTEndpointURL

     onApplyFeatureEditsStatusChanged: {...}

}

 

featureLayer.featureTable = myTableFromURL;
appMap.addLayer(featureLayer);

 

Then I waited for the FeatureLayer to initialize and verified that my table did too:

if (myTableFromURL.featureTableStatus === Enums.FeatureTableStatusInitialized) {
   
updatesEnabled = true;
}

 

I can run a query to get features from the table/layer, and when the query is completed, loop through the records, updating data as I go:

thisRecord.setAttributeValue("SOME_ATTRIBUTE","SOME_NEW_VALUE");
myTableFromURL.updateFeature(thisRecord.uniqueId, thisRecord);

 

And finally, once all the edits have been made to the features, tell the table to apply the changes:

myTableFromURL.applyFeatureEdits();

 

The edits are visible in the feature layer on arcgis.com.

 

Same process with the flat table (minus making and adding a feature layer to the map) does not work.

 

Is there a similar method to initialize a flat table (non-geo-enabled) as what happens when a feature layer is added to a map?

 

Thanks in advance,

 

Chris

Outcomes