Answers for "add a new field to a Hosted Feature Layer"

0

add a new field to a Hosted Feature Layer

from arcgis.gis import GIS
from arcgis import features
from arcgis.features import FeatureLayer
from arcgis.features import FeatureLayerCollection
arcpy.env.overwriteOutput = True
gis = GIS("https://ausbats.maps.arcgis.com", "<USERNAME>", "<PASSWORD>") 
bat_url = "https://services5.arcgis.com/wkEdAXzuNvKdAtLV/arcgis/rest/services/Hipposideros_ater_X/FeatureServer/0"
bat_fl = FeatureLayer(bat_url,gis)
new_field = {
    "name": "Taxon",
    "type": "esriFieldTypeString",
    "alias": "Taxon",
    "length": 30,
    "nullable": True,
    "editable": True,
    "visible": True,
    "domain": None
}
update_dict = {"fields": [new_field]}
bat_fl.manager.add_to_definition(update_dict)
Posted by: Guest on April-24-2022

Code answers related to "add a new field to a Hosted Feature Layer"

Python Answers by Framework

Browse Popular Code Answers by Language