Truncate a Feature Layer

Removes all features in a Feature Layer or Table and resets the object ID counter. Truncating a Feature Layer does not change the schema of the data (does not add, remove, or alter existing database columns, constraints, or indexes).

Usage

truncate_layer(x, async = FALSE, attachment_only = FALSE, token = arc_token())

Arguments

x

an object of class FeatureLayer, Table, or ImageServer.

async

default FALSE. It is recommended to set TRUE for larger datasets.

attachment_only

default FALSE. Deletes all the attachments for this layer. None of the layer features will be deleted when TRUE.

token

your authorization token.

Value

a named list with the name "success" and a value of TRUE or FALSE

Examples

if (FALSE) {

  # authorize using code flow
  set_arc_token(auth_code())

  # create a FeatureLayer object
  flayer <- arc_open("your-feature-layer-url")

  # truncate it
  truncate_layer(flayer)
}

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

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close