Select to view content in your preferred language

Set Out Fields.

1388
1
08-04-2018 11:42 PM
cadgism
Regular Contributor

Hi

I want to return only few Attribute fields of the feature instead of All the fields  as it makes the query slower. In Android SDk 10.xx there was a way to limit the outfields by

Query query = new Query();
query.setOutFields(new String[] {"Filed1", "Field2"});‍‍

In 100.x the

QueryParameters 

has no such method as setOutfields. how can I do this please !!

Thanks

0 Kudos
1 Reply
ShellyGill1
Esri Contributor

Hi,

When you call the queryFeaturesAsync method on ServiceFeatureTable, you can indicate which fields you want to be included in the returned features:

public ListenableFuture<FeatureQueryResult> queryFeaturesAsync (QueryParameters queryParameters, ServiceFeatureTable.QueryFeatureFieldsqueryFields)

public ListenableFuture<FeatureQueryResult> populateFromServiceAsync (QueryParameters query, boolean clearCache, Iterable<String> outFields)

Hope this info helps. Regards,

Shelly

0 Kudos