ServiceFeatureTable QML Type

  • Esri.ArcGISRuntime
  • ServiceFeatureTable
  • A feature table created from the URL to an ArcGIS feature service. More...

    Import Statement: import Esri.ArcGISRuntime
    Since: Esri.ArcGISRuntime 100.0
    Inherits:

    ArcGISFeatureTable

    Properties

    Signals

    Methods

    Detailed Description

    A service feature table has a Enums.FeatureRequestMode, which controls (1) whether features are cached locally (for quicker access by map and scene layers) and (2) whether queries are performed on the local cache or on the server. You can retrieve or modify a table's feature request mode using Enums.FeatureRequestMode.

    If the table's mode is Enums.FeatureRequestModeOnInteractionCache, features are requested from the server in response to user or developer interaction (pan or zoom) and are cached locally. Queries are executed on the cache or (if requested features are not resident in the cache) on the server. This mode is the default.

    If the table's mode is Enums.FeatureRequestModeOnInteractionNoCache, features are always requested from the server. Features are not cached, and all queries are executed on the server.

    If the table's mode is Enums.FeatureRequestModeManualCache, you must call ServiceFeatureTable::populateFromService(QueryParameters, bool, list<string>), which populates the local table with the features specified by QueryParameters and containing the attributes specified by QStringList. Features are cached for the duration of the session and queries are executed against the cache.

    If the table's feature request mode is onInteractionCache or onInteractionNoCache, ArcGISFeatures in the table initially contain a minimum set of attributes and geometry that omits any m-values. This is an optimization for faster rendering. To access all attributes (and geometry with m-values) in features you get from a query, do one of the following:

    When used to create a FeatureLayer in a MapView, features are requested from the services in the correct spatial reference to match the spatial reference of the map.

    Use ArcGISRuntimeEnvironment::serviceCurveGeometryMode to change how curve geometries are returned from the service, if supported. See ArcGISFeatureServiceInfo::supportsTrueCurve.

    You can use a service feature table to access non-spatial tables from feature services where FeatureTable::hasGeometry is false. The feature request mode of the table must be Enums.FeatureRequestModeManualCache, and you must call ServiceFeatureTable::populateFromService(QueryParameters, bool, list<string>).

    The parent class definition allows a service feature table to have editable attribute fields, feature templates, feature types, and editing capabilities defined in ArcGISFeatureLayerInfo::capabilities. See FeatureTemplate and FeatureType.

    A service feature table might require authentication to access the service.

    See also ApiKeyResource, Cancelable, Loadable, RemoteResource, and FeatureLayer.

    Property Documentation

    [since Esri.ArcGISRuntime 100.10] apiKey : string

    Returns the API key.

    This property was introduced in Esri.ArcGISRuntime 100.10.

    See also ApiKeyResource.


    [read-only] applyEditsResult : list<FeatureEditResult>

    Returns the results of the applyEdits asynchronous task (read-only).


    [read-only] applyEditsStatus : Enums.TaskStatus

    Returns the status of the applyEdits asynchronous task (read-only).

    See also Enums.TaskStatus.


    bufferFactor : double

    The factor used to determine the size of the buffer around the map's current extent for which data is retrieved from the service.

    The bufferFactor property only applies when to Enums.FeatureRequestModeOnInteractionCache.

    Data is not retrieved again until either it expires or the map extent changes and is no longer located in the buffered extent. The buffer factor can be a value up to 10. If it is set to 0 or 1, then every time the map extent is changed, data for that extent will be requested from the service.

    The Default value is 2.0.


    [default] credential : Credential

    The security credential used to access the feature service.

    This is only applicable if the service is secured.


    [since Esri.ArcGISRuntime 100.2] definitionExpression : string

    The SQL statement where clause used to filter the features by attributes.

    The definition expression string uses the SQL-92 WHERE clause syntax. Be sure to escape special characters in the expression string as required for your platform. The DATE keyword expects the date format yyyy-mm-dd and the TIMESTAMP keyword expects the time stamp format yyyy-mm-dd hh:mm:ss. See the ArcGIS Blog article Querying Feature Services Date-Time Queries for more information.

    This property was introduced in Esri.ArcGISRuntime 100.2.


    featureRequestMode : Enums.FeatureRequestMode

    The mode used to retrieve features from the service.

    The default value is Enums.FeatureRequestModeOnInteractionCache.

    See also Enums.FeatureRequestMode.


    geodatabaseVersion : string

    The geodatabase version.


    [default, since Esri.ArcGISRuntime 100.3] initItem : ArcGISItem

    The existing ArcGISItem used to create the table.

    This property can be used in conjunction with the initLayerId property.

    The Item must be a PortalItem and correspond to a map service or a feature service.

    This property was introduced in Esri.ArcGISRuntime 100.3.


    [since Esri.ArcGISRuntime 100.3] initLayerId : string

    The layer ID of the service's layer to use to create the table.

    This property must be used in conjunction with the initItem property.

    Note: The underlying property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

    Note: initLayerId and initLayerIdAsInt can be used interchangeably. Both reference the same underlying API property.

    This property was introduced in Esri.ArcGISRuntime 100.3.

    See also initLayerIdAsInt.


    [since Esri.ArcGISRuntime 100.3] initLayerIdAsInt : int

    The same as initLayerId but represented as an integer type (read-only).

    Note: The underlying property is represented as a 64-bit integer type. See Accessing 64-bit integer properties from QML.

    Note: initLayerIdAsInt and initLayerId can be used interchangeably. Both reference the same underlying API property.

    This property was introduced in Esri.ArcGISRuntime 100.3.


    [default, since Esri.ArcGISRuntime 100.1] initRelatedTable : ServiceFeatureTable

    The table to relate to this table using relationshipInfo.

    This property was introduced in Esri.ArcGISRuntime 100.1.


    [read-only, since Esri.ArcGISRuntime 100.3] loadOrRefreshFeaturesStatus : Enums.TaskStatus

    Returns the status of the loadOrRefreshFeatures asynchronous task (read-only).

    This property was introduced in Esri.ArcGISRuntime 100.3.

    See also Enums.TaskStatus.


    [read-only] populateFromServiceResult : list<FeatureQueryResult>

    Returns the results of the populateFromService asynchronous task (read-only).


    [read-only] populateFromServiceStatus : Enums.TaskStatus

    Returns the status of the populateFromService asynchronous task (read-only).

    See also Enums.TaskStatus.


    [default, since Esri.ArcGISRuntime 100.1] relationshipInfo : RelationshipInfo

    Description of the relationship between this table and the initRelatedTable.

    This property was introduced in Esri.ArcGISRuntime 100.1.


    [default, since Esri.ArcGISRuntime 100.1] requestConfiguration : RequestConfiguration

    The configuration parameters used for network requests sent by this task.

    This property was introduced in Esri.ArcGISRuntime 100.1.


    [read-only, since Esri.ArcGISRuntime 100.9] serviceGeodatabase : ServiceGeodatabase

    The service geodatabase this service feature table is part of (read-only).

    This property was introduced in Esri.ArcGISRuntime 100.9.


    [read-only, since Esri.ArcGISRuntime 100.3] undoLocalEditsStatus : Enums.TaskStatus

    Returns the status of the undoLocalEdits asynchronous task (read-only).

    This property was introduced in Esri.ArcGISRuntime 100.3.

    See also Enums.TaskStatus.


    url : url

    The url of an individual layer or table in an ArcGIS map service or feature service whose data needs to be accessed or edited.


    Signal Documentation

    [since Esri.ArcGISRuntime 100.10] apiKeyChanged()

    Emitted when the apiKey property changes.

    Note: The corresponding handler is onApiKeyChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.10.

    See also ApiKeyResource.


    applyEditsStatusChanged()

    Emitted when the applyEditsStatus property changes.

    Note: The corresponding handler is onApplyEditsStatusChanged.


    bufferFactorChanged()

    Emitted when the bufferFactor property changes.

    Note: The corresponding handler is onBufferFactorChanged.


    credentialChanged()

    Emitted when the credential property changes.

    Note: The corresponding handler is onCredentialChanged.


    [since Esri.ArcGISRuntime 100.2] definitionExpressionChanged()

    Emitted when the definitionExpression property changes.

    Note: The corresponding handler is onDefinitionExpressionChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.2.


    featureRequestModeChanged()

    Emitted when the featureRequestMode property changes.

    Note: The corresponding handler is onFeatureRequestModeChanged.


    geodatabaseVersionChanged()

    Emitted when the geodatabaseVersion property changes.

    Note: The corresponding handler is onGeodatabaseVersionChanged.


    [since Esri.ArcGISRuntime 100.3] initItemChanged()

    Emitted when the initItem property changes.

    Note: The corresponding handler is onInitItemChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.3.


    [since Esri.ArcGISRuntime 100.3] initLayerIdAsIntChanged()

    Emitted when the initLayerIdAsInt property changes.

    Note: The corresponding handler is onInitLayerIdAsIntChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.3.


    [since Esri.ArcGISRuntime 100.3] initLayerIdChanged()

    Emitted when the initLayerId property changes.

    Note: The corresponding handler is onInitLayerIdChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.3.


    [since Esri.ArcGISRuntime 100.1] initRelatedTableChanged()

    Emitted when the initRelatedTable property changes.

    Note: The corresponding handler is onInitRelatedTableChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.1.


    [since Esri.ArcGISRuntime 100.3] loadOrRefreshFeaturesStatusChanged()

    Emitted when the loadOrRefreshFeaturesStatus property changes.

    Note: The corresponding handler is onLoadOrRefreshFeaturesStatusChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.3.


    populateFromServiceStatusChanged()

    Emitted when the populateFromServiceStatus property changes.

    Note: The corresponding handler is onPopulateFromServiceStatusChanged.


    [since Esri.ArcGISRuntime 100.1] relationshipInfoChanged()

    Emitted when the relationshipInfo property changes.

    Note: The corresponding handler is onRelationshipInfoChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.1.


    [since Esri.ArcGISRuntime 100.1] requestConfigurationChanged()

    Emitted when the requestConfiguration property changes.

    Note: The corresponding handler is onRequestConfigurationChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.1.


    [since Esri.ArcGISRuntime 100.3] undoLocalEditsStatusChanged()

    Emitted when the undoLocalEditsStatus property changes.

    Note: The corresponding handler is onUndoLocalEditsStatusChanged.

    This signal was introduced in Esri.ArcGISRuntime 100.3.


    urlChanged()

    Emitted when the url property changes.

    Note: The corresponding handler is onUrlChanged.


    Method Documentation

    string applyEdits()

    Uploads any changes to the local table to the feature service.

    ServiceFeatureTable::applyEdits is meant to be used for single table workflows or tables without geodatabase behavior (see below). If an edit on this table can cause an edit to another table due to geodatabase behavior, it is highly recommended to use ServiceGeodatabase::applyEdits instead to prevent data inconsistency, so that dependent edits are all applied or none are (if an error occurs). For example, when tables have a composite relationship, applying the delete of a destination feature in a composite relationship deletion will only delete the destination feature on the server, therefore causing inconsistency in the data. Areas that have geodatabase behavior:

    • Composite relationships
    • Annotation feature layers
    • Utility network association deletion semantics
    • Attribute rules

    Returns a task ID that can be used to cancel the applyEdits task.

    See also Enums.TaskStatus and Cancelable.


    void clearCache(bool keepLocalEdits)

    Clears all the data in the table, including any temporary edits. The keepLocalEdits is default to true.

    If keepLocalEdits is true, then edited rows in the table won't be cleared.


    [since Esri.ArcGISRuntime 100.3] string loadOrRefreshFeatures(list<Feature> features)

    Loads all attributes and geometries for unloaded features, and refetches attributes and geometries for previously loaded features.

    This method uses an asynchronous task that cannot be started if it is already running from a previous call to loadOrRefreshFeatures. You can check that the loadOrRefreshFeaturesStatus property is not Enums.TaskStatusInProgress before calling this method.

    Features you get from ServiceFeatureTable::queryFeaturesWithFieldOptions() or ServiceFeatureTable::queryRelatedFeaturesWithFieldOptions might be in the minimally loaded state (minimum attributes required for rendering and no m-values). To load all attributes, pass a list of the features to this method.

    After the task starts, you may use the signal loadOrRefreshFeaturesStatus to monitor task status.

    After calling this method, any non-applied edits on the table will be lost.

    • features. The list of features to be loaded/refreshed. Any features requested but not returned by the server will have its OBJECTID cleared (set to an invalid negative value) to indicate it is no longer associated with the service feature table.

    Note: This method will not refresh feature attachments. Use AttachmentListModel::fetchAttachments on each feature to retrieve attachments instead.

    Note: After calling this method, any non-applied local edits on the table will be lost.

    This method was introduced in Esri.ArcGISRuntime 100.3.

    See also Enums.TaskStatus and Cancelable.


    string populateFromService(QueryParameters parameters, bool clearCache, list<string> outFields)

    Queries the feature service and places the resulting features in the local table, which is cached for the duration of the session.

    Requests data from the service using specified query parameters, whether to clear the existing cache with clearCache and the specified outFields. The fetched data is added to the local copy of the table.

    This method uses an asynchronous task that cannot be started if it is already running from a previous call to populateFromService. You should check that the populateFromServiceStatus property is not Enums.TaskStatusInProgress before calling this method. After the task starts, you may use the signal populateFromServiceStatusChanged to monitor task status.

    The ServiceFeatureTable must have its ServiceFeatureTable::featureRequestMode set to Enums.FeatureRequestModeManualCache.

    This method is useful for non-geographic data. It is also helpful when you want to avoid accessing the service for a feature whose geometry is in the current extent of the map or scene.

    Specifying null or an empty list for outFields results in the minimum set of fields being used when populating the local table. This is the same set of attributes described for Enums.FeatureRequestModeOnInteractionCache or Enums.FeatureRequestModeOnInteractionNoCache.

    See also Enums.TaskStatus and Cancelable.


    string queryFeaturesWithFieldOptions(QueryParameters parameters, Enums.QueryFeatureFields queryFeatureFields)

    Queries features from this table's cache and/or from the feature service used to create this table.

    • parameters - Parameters that specify how to filter the query and return results.
    • queryFeatureFields - An Enums.QueryFeatureFields enumeration value indicating which fields to return from the query.

    If the table's mode is Enums.FeatureRequestModeManualCache, you must call ServiceFeatureTable::populateFromService, which populates the local table with the features specified by QueryParameters and containing the attributes specified by outfields. Features are cached for the duration of the session and queries are executed against the cache.

    If the mode is Enums.FeatureRequestModeOnInteractionCache, then the query is performed on the local cache, provided that the geometries of the features are within an extent that has been cached; otherwise, the query is performed on the server. If the mode is Enums.FeatureRequestModeOnInteractionNoCache, the query is always performed on the server.

    The Enums.QueryFeatureFields control which fields will be included with the returned features.

    • A table whose feature request mode is Enums.FeatureRequestModeManualCache contains all fields that you specified when calling ServiceFeatureTable::populateFromService.
    • A table whose feature request mode is OnInteractionCache or OnInteractionNoCache initially contains features with a minimum set of attributes required for rendering. You must load a feature to access all its attributes. The enum Enums.QueryFeatureFieldsLoadAll automatically loads the returned features into the local table, which makes all attributes available.

      You can also query on any attribute defined by the feature service's table. If the attribute is not in the minimum set of attributes in your local table, the query will be performed on the server.

    ServiceFeatureTable::queryFeaturesWithFieldOptions() may be run concurrently. The last result will always be stored in the queryFeaturesResult property. To keep track of concurrent tasks, the queryFeaturesResults property can be used to sort multiple results, mapped to the task ID of each task.

    Returns a task ID that can be used to cancel the ServiceFeatureTable::queryFeaturesWithFieldOptions() task. The task ID is also used to locate the specific result in queryFeaturesResults for this task.

    See also Cancelable.


    [since Esri.ArcGISRuntime 100.1] string queryRelatedFeaturesWithFieldOptions(Feature feature, RelatedQueryParameters relatedQueryParameters, Enums.QueryFeatureFields queryFeatureFields)

    Queries for features related to the given feature using the given related query parameters and query feature fields.

    • feature - The feature whose related features are to be queried.
    • relatedQueryParameters - Parameters that specify how to filter the query and return results.
    • queryFeatureFields - An Enums.QueryFeatureFields enumeration value indicating which fields to return from the query.

    Only returns results from tables that have been added to the map that this table is associated with.

    The queryRelatedFeaturesStatusChanged signal emits when the operation is complete. Check the queryRelatedFeaturesStatus property to make sure the operation completed successfully. The results are then available through queryRelatedFeaturesResults.

    This method was introduced in Esri.ArcGISRuntime 100.1.

    See also Cancelable.


    [since Esri.ArcGISRuntime 100.3] string undoLocalEdits()

    Undoes all of the local edits since the last server acknowledgment.

    ServiceFeatureTable::undoLocalEdits is meant to be used for single table workflows or tables without geodatabase behavior (see below). If the service which the table belongs to has geodatabase behavior, it is highly recommended to use ServiceGeodatabase::undoLocalEdits.

    Undoing edits in one table can cause data inconsistencies between the local cache and the service if this method is used. For example, when tables have a composite relationship, undoing only the origin feature would violate the composite relationship rule that an origin and destination feature must be either deleted together or not at all.

    Areas which have geodatabase behavior:

    • Composite relationships
    • Annotation feature layers
    • Utility network association deletion semantics
    • Attribute rules

    This method was introduced in Esri.ArcGISRuntime 100.3.

    See also Enums.TaskStatus and Cancelable.


    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.