# command: edit.add-attachment
Description: Create and add an attachment to a provided feature, using the given attachment data.

Inputs: `( AddAttachmentArgs | WebAddAttachmentArgs )`

AddAttachmentArgs properties:
```json
{
  "contentType": {
    "description": "The MIME content type of the attachment.",
    "type": "string",
    "isRequired": "true"
  },
  "data": {
    "description": "The binary data for the attachment.",
    "items": {
      "type": "number"
    },
    "type": "array",
    "isRequired": "true"
  },
  "features": {
    "description": "Features to use for the command/operation."
  },
  "maps": {
    "description": "The map.",
    "isRequired": "true"
  },
  "name": {
    "description": "The name of the attachment.",
    "type": "string",
    "isRequired": "true"
  }
}
```

WebAddAttachmentArgs properties:
```json
{
  "blobs": {
    "anyOf": [
      {
        "$ref": "File"
      },
      {
        "items": {
          "$ref": "File"
        },
        "type": "array"
      }
    ],
    "description": "The blob(s) that contains the file attachment(s). If multiple attachments are specified, all attachments will be added to the feature(s).",
    "isRequired": "true"
  },
  "features": {
    "description": "The feature(s) to add the attachment(s) to. If multiple features are specified, the attachment(s) will be added to all features.",
    "isRequired": "true"
  }
}
```

---
# command: edit.add-feature
Description: Adds a feature to a particular layer. `Features` and `EditCommandArgs` are not supported on Mobile.

Inputs: `( @vertigis.api-docs.Features FeatureSet|FeatureList|FeatureStream | T_60 | ( @vertigis.arcgis-extensions.data.Feature.FeatureProperties | T_60 )[] | Results | EditCommandArgs )`

@vertigis.arcgis-extensions.data.Feature.FeatureProperties properties:
```json
{
  "attributes": {
    "anyOf": [
      {},
      {
        "$ref": "Map"
      }
    ],
    "description": "The feature's attributes, keyed by field name."
  },
  "failureMode": {
    "description": "See {@link support /InitializableBase!InitializableBase.failureMode}."
  },
  "geometry": {
    "anyOf": [
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Extent.Extent"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Multipoint.Multipoint"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Point.Point"
      },
      {
        "$ref": "T_6"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Polyline.Polyline"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Mesh.Mesh"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PointJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.MultipointJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PolylineJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PolygonJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.ExtentJson"
      }
    ],
    "description": "The feature's geometry."
  },
  "id": {
    "description": "The unique ID to assign to the entity. If not specified, one will be generated.",
    "type": "string"
  },
  "schema": {
    "description": "Metadata about the feature, such as fields, domains, geometry type, etc."
  },
  "settings": {
    "description": "Settings for this feature."
  },
  "source": {
    "description": "The source of the feature."
  }
}
```

Results properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  }
}
```

EditCommandArgs properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "showNotifications": {
    "description": "Whether to show UI notifications. Will default to `true`.",
    "type": "boolean"
  }
}
```

---
# command: edit.bulk-attribute-update
Description: Updates multiple features from multiple sources simultaneously. This command commits the bulk attribute changes directly to the feature source. Web only.

Inputs: `BulkAttributeUpdateArgs`

BulkAttributeUpdateArgs properties:
```json
{
  "attributes": {
    "description": "The attributes to update on all features.",
    "isRequired": "true"
  },
  "features": {
    "description": "Features to use for the command/operation."
  },
  "overrides": {
    "description": "Optional list of bulk attribute update overrides to the values of participating and non-participating fields, keyed by feature.id and then by field name.\n\n**Example:** Override field `color` and feature with id = \"8a9214f5-aa9e-4bbb-a24a-28cc6f59e0af\".\n\n```\n{\n    \"8a9214f5-aa9e-4bbb-a24a-28cc6f59e0af\": {\n        \"color\": \"Green\"\n    }\n}\n```"
  }
}
```

---
# command: edit.cancel
Description: Cancels active editing sessions and discards any changes. If a feature is supplied, only the sessions using that feature will be cancelled. Web only.

Inputs: `Features`

Features properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  }
}
```

---
# command: edit.complete
Description: Completes active editing sessions and submits any changes made to the attributes, attachments or geometry to the feature source. If a feature is supplied, only sessions using that feature will complete. Web only.

Inputs: `Features`

Features properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  }
}
```

---
# command: edit.delete-attachment
Description: Deletes attachments from feature(s).

Inputs: `DeleteAttachmentArgs`

DeleteAttachmentArgs properties:
```json
{
  "attachments": {
    "description": "The attachment(s) to remove from the feature(s). This property can be populated with the title(s) or ID(s) of the attachments(s). Any and all matching attachments found on the input features will be deleted. Web only.",
    "items": {
      "type": "string"
    },
    "type": "array"
  },
  "features": {
    "description": "The feature(s) to remove the attachment(s) from.",
    "isRequired": "true"
  },
  "gcxAttachment": {
    "description": "The attachment to remove from the feature(s). Mobile only."
  }
}
```

---
# command: edit.delete-features
Description: Deletes the given feature or features from their feature sources. `EditCommandArgs` is not supported on Mobile.

Inputs: `( @vertigis.api-docs.Features FeatureSet|FeatureList|FeatureStream | T_60 | ( @vertigis.arcgis-extensions.data.Feature.FeatureProperties | T_60 )[] | Results | EditCommandArgs )`

@vertigis.arcgis-extensions.data.Feature.FeatureProperties properties:
```json
{
  "attributes": {
    "anyOf": [
      {},
      {
        "$ref": "Map"
      }
    ],
    "description": "The feature's attributes, keyed by field name."
  },
  "failureMode": {
    "description": "See {@link support /InitializableBase!InitializableBase.failureMode}."
  },
  "geometry": {
    "anyOf": [
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Extent.Extent"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Multipoint.Multipoint"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Point.Point"
      },
      {
        "$ref": "T_6"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Polyline.Polyline"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Mesh.Mesh"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PointJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.MultipointJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PolylineJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PolygonJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.ExtentJson"
      }
    ],
    "description": "The feature's geometry."
  },
  "id": {
    "description": "The unique ID to assign to the entity. If not specified, one will be generated.",
    "type": "string"
  },
  "schema": {
    "description": "Metadata about the feature, such as fields, domains, geometry type, etc."
  },
  "settings": {
    "description": "Settings for this feature."
  },
  "source": {
    "description": "The source of the feature."
  }
}
```

Results properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  }
}
```

EditCommandArgs properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "showNotifications": {
    "description": "Whether to show UI notifications. Will default to `true`.",
    "type": "boolean"
  }
}
```

---
# command: edit.display-add-feature
Description: Begin an interactive feature editing session with a new feature. `DisplayAddFeatureArgs` is not supported on Mobile.

**Example:** Create and allow the user to edit a new feature with an initial attributes collection. If no geometry is provided in context they will be asked to select one.

_Note:_ "maps" argument can be the output of a 'Get Map' activity run in Web by Workflow or coming from a previous operation in the action chain. When the map and/or layer are provided in the context of a command chain these parameters can be omitted.

```
{
    "editAttributes": true,
    "editGeometry": true,
    "featureAttributes": {
        "ASSET_ID": "WFH001234"
    },
    "layers": "Victoria_Fire_Hydrants_8780"
}
```

Inputs: `( @vertigis.arcgis-extensions.data.FeatureSource.FeatureSource | DisplayAddFeatureArgs )`

DisplayAddFeatureArgs properties:
```json
{
  "editAttachments": {
    "description": "Whether to allow editing of feature attachments.",
    "type": "boolean"
  },
  "editAttributes": {
    "description": "Whether to allow editing of feature attributes.",
    "type": "boolean"
  },
  "editGeometry": {
    "description": "Whether to allow editing of feature geometry.",
    "type": "boolean"
  },
  "editGeometryOptions": {
    "description": "Options for the geometry editing session."
  },
  "featureAttributes": {
    "description": "A collection of attributes to apply to the new feature."
  },
  "fieldElements": {
    "description": "A collection of configuration overrides for the editable fields. Web only.",
    "items": {
      "$ref": "__type"
    },
    "type": "array"
  },
  "formUITarget": {
    "description": "Arguments for the display of the attribute editing form. Web only."
  },
  "geometry": {
    "description": "The geometry to use for the command/operation."
  },
  "layers": {
    "description": "Layer(s) to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  },
  "orientation": {
    "description": "The orientation of the template picker. Defaults to \"vertical\".",
    "enum": [
      "horizontal",
      "vertical"
    ],
    "type": "string"
  },
  "pluginSettings": {
    "description": "Additional settings that are specific to sketching plugins, keyed by plugin ID. The only currently supported plugin is \"snapping\". A boolean value can also be assigned to completely disable, or enable with default settings."
  },
  "showNotifications": {
    "description": "Whether to show UI notifications. Defaults to `true`.",
    "type": "boolean"
  },
  "showTitles": {
    "description": "Whether to show titles on the template picker. Defaults to `true`.",
    "type": "boolean"
  },
  "templateName": {
    "description": "The template to use as a starting point for this feature. Requires a layer. The default or first template will be used if not set.",
    "type": "string"
  },
  "templateUITarget": {
    "description": "Arguments for the display of the template picker. Web only."
  },
  "typeId": {
    "description": "A type id to use as a starting point for this feature. This may return one or more templates and requires a layer with types defined.",
    "type": "string"
  }
}
```

---
# command: edit.display-add-related-feature
Description: Begin an interactive feature editing session for a new related feature. The specified feature will be the original feature that the new related feature will be added to in the relationship.

**Example:** Create and edit a new record on a related table, with the option to add attachments. Make sure the 'COMMENTS' field is included in the editable attributes and make it required.

_Notes:_.

1. The feature used here must come from the running viewer, and cannot be an    ad-hoc feature created from a JSON object. For example, you can use    the output of `results.get-active-features`, or the feature provided    in a command chain context.
2. `editableExpression` and `requiredExpression` both take an Arcade    expression, and here the string "true" is just a simple Arcade    expression that always returns true. You can also use a more complex    expression, or reference one from your webmap.

```
{
    "editAttributes": true,
    "editAttachments": true,
    "relationshipId": "1",
    "fieldElements": [
        {
            "fieldName": "COMMENTS",
            "editableExpression": "true",
            "requiredExpression": "true"
        }
    ]
}
```

Inputs: `DisplayAddRelatedFeatureArgs`

DisplayAddRelatedFeatureArgs properties:
```json
{
  "editAttachments": {
    "description": "Whether to allow editing of feature attachments.",
    "type": "boolean"
  },
  "editAttributes": {
    "description": "Whether to allow editing of feature attributes.",
    "type": "boolean"
  },
  "editGeometry": {
    "description": "Whether to allow editing of feature geometry.",
    "type": "boolean"
  },
  "editGeometryOptions": {
    "description": "Options for the geometry editing session."
  },
  "featureAttributes": {
    "description": "A collection of attributes to apply to the new feature."
  },
  "features": {
    "description": "Features to use for the command/operation."
  },
  "fieldElements": {
    "description": "A collection of configuration overrides for the editable fields. Web only.",
    "items": {
      "$ref": "__type"
    },
    "type": "array"
  },
  "formUITarget": {
    "description": "Arguments for the display of the attribute editing form. Web only."
  },
  "geometry": {
    "description": "The geometry to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  },
  "orientation": {
    "description": "The orientation of the template picker. Defaults to \"vertical\".",
    "enum": [
      "horizontal",
      "vertical"
    ],
    "type": "string"
  },
  "pluginSettings": {
    "description": "Additional settings that are specific to sketching plugins, keyed by plugin ID. The only currently supported plugin is \"snapping\". A boolean value can also be assigned to completely disable, or enable with default settings."
  },
  "relatedFeatureSource": {
    "description": "The feature source for the related feature to create. Mobile only.",
    "isRequired": "true"
  },
  "relationshipId": {
    "description": "The ID of the relationship to add a feature to.",
    "type": "string",
    "isRequired": "true"
  },
  "showNotifications": {
    "description": "Whether to show UI notifications. Defaults to `true`.",
    "type": "boolean"
  },
  "showTitles": {
    "description": "Whether to show titles on the template picker. Defaults to `true`.",
    "type": "boolean"
  },
  "templateName": {
    "description": "The template to use as a starting point for this feature. Requires a layer. The default or first template will be used if not set.",
    "type": "string"
  },
  "templateUITarget": {
    "description": "Arguments for the display of the template picker. Web only."
  },
  "typeId": {
    "description": "A type id to use as a starting point for this feature. This may return one or more templates and requires a layer with types defined.",
    "type": "string"
  }
}
```

---
# command: edit.display-update-feature
Description: Begin an interactive feature editing session with an existing feature. `DisplayUpdateFeatureArgs` is not supported on Mobile.

Inputs: `( T_60 | DisplayUpdateFeatureArgs )`

DisplayUpdateFeatureArgs properties:
```json
{
  "attributes": {
    "description": "Optional layout XML attributes to be used for the transient UI container."
  },
  "editAttachments": {
    "description": "Whether to allow editing of feature attachments.",
    "type": "boolean"
  },
  "editAttributes": {
    "description": "Whether to allow editing of feature attributes.",
    "type": "boolean"
  },
  "editGeometry": {
    "description": "Whether to allow editing of feature geometry.",
    "type": "boolean"
  },
  "editGeometryOptions": {
    "description": "Options for the geometry editing session."
  },
  "featureAttributes": {
    "description": "A collection of attributes to automatically apply to the updated feature."
  },
  "features": {
    "description": "Features to use for the command/operation."
  },
  "fieldElements": {
    "description": "A collection of configuration overrides for the editable fields.",
    "items": {
      "$ref": "__type"
    },
    "type": "array"
  },
  "geometry": {
    "description": "The geometry to use for the command/operation."
  },
  "icon": {
    "description": "Optional icon that may be used by the transient UI container.",
    "type": "string"
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  },
  "orientation": {
    "description": "The orientation of the template picker. Defaults to \"vertical\".",
    "enum": [
      "horizontal",
      "vertical"
    ],
    "type": "string"
  },
  "parent": {
    "description": "The layout ID or ItemRef to target for the command/operation. This component will be the parent of the temporary UI that will be removed after the command/operation completes."
  },
  "pluginSettings": {
    "description": "Additional settings that are specific to sketching plugins, keyed by plugin ID. The only currently supported plugin is \"snapping\". A boolean value can also be assigned to completely disable, or enable with default settings."
  },
  "showNotifications": {
    "description": "Whether to show UI notifications. Will default to `true`.",
    "type": "boolean"
  },
  "showTitles": {
    "description": "Whether to show titles on the template picker. Defaults to `true`.",
    "type": "boolean"
  }
}
```

---
# command: edit.update-feature
Description: Updates a layer feature or features. Edits to the geometry and attributes of the supplied features will be committed to their respective feature sources. `Features` and `EditCommandArgs` are not supported on Mobile.

Inputs: `( @vertigis.api-docs.Features FeatureSet|FeatureList|FeatureStream | T_60 | ( @vertigis.arcgis-extensions.data.Feature.FeatureProperties | T_60 )[] | Results | EditCommandArgs )`

@vertigis.arcgis-extensions.data.Feature.FeatureProperties properties:
```json
{
  "attributes": {
    "anyOf": [
      {},
      {
        "$ref": "Map"
      }
    ],
    "description": "The feature's attributes, keyed by field name."
  },
  "failureMode": {
    "description": "See {@link support /InitializableBase!InitializableBase.failureMode}."
  },
  "geometry": {
    "anyOf": [
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Extent.Extent"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Multipoint.Multipoint"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Point.Point"
      },
      {
        "$ref": "T_6"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Polyline.Polyline"
      },
      {
        "$ref": "#/definitions/@arcgis.core.geometry.Mesh.Mesh"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PointJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.MultipointJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PolylineJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.PolygonJson"
      },
      {
        "$ref": "#/definitions/esri.rest-api.GeometryJson.ExtentJson"
      }
    ],
    "description": "The feature's geometry."
  },
  "id": {
    "description": "The unique ID to assign to the entity. If not specified, one will be generated.",
    "type": "string"
  },
  "schema": {
    "description": "Metadata about the feature, such as fields, domains, geometry type, etc."
  },
  "settings": {
    "description": "Settings for this feature."
  },
  "source": {
    "description": "The source of the feature."
  }
}
```

Results properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "maps": {
    "description": "Map(s) to use for the command/operation."
  }
}
```

EditCommandArgs properties:
```json
{
  "features": {
    "description": "Features to use for the command/operation."
  },
  "showNotifications": {
    "description": "Whether to show UI notifications. Will default to `true`.",
    "type": "boolean"
  }
}
```

---
# command: edit.update-session
Description: Updates an in-progress interactive feature editing session with new attributes, attachments, or geometry. These will be immediately applied to the current session, if one is active. Web only.

Inputs: `UpdateSessionArgs`

UpdateSessionArgs properties:
```json
{
  "attachments": {
    "description": "An array of attachments that apply or are to be applied to the currently edited feature.",
    "items": {
      "$ref": "T_10"
    },
    "type": "array"
  },
  "attributes": {
    "description": "A collection of attributes that apply or are to be applied to the currently edited feature."
  },
  "geometry": {
    "description": "The geometry to use for the command/operation."
  }
}
```

---
