AnsweredAssumed Answered

FeatureTable Query - Relationships

Question asked by chad.yoder@nwg on Apr 4, 2017
Latest reply on Apr 6, 2017 by chad.yoder@nwg

Trying to wire up a basic table query, but not having much luck.  The goal would be to add some initial support for relationships (I know it's coming soon), but we have folks asking for it now.

 

To test/develop, we downloaded the manhole inspection template from the water data model and published it to AGOL.  The only change made was to link based on GlobalId, rather than FacilityId.

 

There is currently only one record, with a single related record.  The related record was created using Collector (maybe that was the issue??).  Everything works fine if you add the data to an AGOL web map, we can see the related record.

 

The following code returns no records, although using the same query directly on the REST API returns the record.  

 

var destTable = new ServiceFeatureTable (new Uri (
"http://services6.arcgis.com/v1B7paWSaOfBIIVv/ArcGIS/rest/services/ManholeInspections/FeatureServer/1"
));
destTable.FeatureRequestMode = FeatureRequestMode.OnInteractionCache;

await destTable.LoadAsync ();
                        
var query = "ManholeNumber = 'dd11f844-16b0-4e86-9fbd-ca77275dba0e'";
FeatureQueryResult queryResult = await destTable.QueryFeaturesAsync (new QueryParameters () {
   WhereClause = query
}, QueryFeatureFields.LoadAll);

var ftrs = queryResult.ToList ();
if (ftrs.Any ()) {
   //Handle the results
};

Outcomes