Hello,
I have an existing feature layer published from a csv file that I'm trying to add to a webmap. I have the following code that runs without errors but when I go back into the GUI (through ArcGIS online) the layer doesn't show up as having been added.
from arcgis.gis import GIS
from arcgis.mapping import WebMap
from arcgis.features import FeatureLayer
from pprint import pprint
print("Logging in...")
gis = GIS("https://fotnf.maps.arcgis.com/", "friendsofthetonto", "xyz")
print(f"Connected to {gis.properties.portalHostname} as {gis.users.me.username}")
webmap_item = gis.content.get('e1405425e52d43689cfdaecd43e0239d')
webmap = WebMap(webmap_item)
csv_item2 = gis.content.get('ec6e29fe17a44512887d761f5e3524d6')
csv_layer2 = FeatureLayer(csv_item2.url)
webmap.add_layer(csv_item2)
webmap_item.update(data=webmap)