<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Issue with attribute types when publishing GeoJSON to ArcGIS Online in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/issue-with-attribute-types-when-publishing-geojson/m-p/1307894#M53349</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to publish a GeoJSON file containing lines and points to ArcGIS Online. The publication process is successful, resulting in a Feature Layer with two layers - point and line. Everything looks fine, except that all attributes are automatically converted to the "string" type. I've attempted to modify the attribute types using the following code, but I haven't achieved the desired outcome. The attributes still remain as "string" instead of the intended "date" type.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Name of the layer you want to load
layer_name = "Test GeoJSON File"

# Retrieve the Feature Layer through search
layer = gis_agol.content.search(query=layer_name, item_type="Feature Layer")[0]

# Get the Feature Layer object
feature_layer = layer.layers[0]

# Retrieve information about the attribute table of the Feature Layer
attributes = feature_layer.properties['fields']

# Define new attribute types to be used
new_types = {
    "realizace_do": "esriFieldTypeDate",
    # Continue with other attributes you want to modify
}

# Update the attribute types in the attribute table of the Feature Layer
for attribute in attributes:
    attribute_name = attribute['name']
    if attribute_name in new_types:
        attribute_type = new_types[attribute_name]
        attribute['type'] = attribute_type

feature_layer.manager.update_definition({'fields': attributes})&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 13 Jul 2023 13:28:04 GMT</pubDate>
    <dc:creator>JiříKomínek</dc:creator>
    <dc:date>2023-07-13T13:28:04Z</dc:date>
    <item>
      <title>Issue with attribute types when publishing GeoJSON to ArcGIS Online</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/issue-with-attribute-types-when-publishing-geojson/m-p/1307894#M53349</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm trying to publish a GeoJSON file containing lines and points to ArcGIS Online. The publication process is successful, resulting in a Feature Layer with two layers - point and line. Everything looks fine, except that all attributes are automatically converted to the "string" type. I've attempted to modify the attribute types using the following code, but I haven't achieved the desired outcome. The attributes still remain as "string" instead of the intended "date" type.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Name of the layer you want to load
layer_name = "Test GeoJSON File"

# Retrieve the Feature Layer through search
layer = gis_agol.content.search(query=layer_name, item_type="Feature Layer")[0]

# Get the Feature Layer object
feature_layer = layer.layers[0]

# Retrieve information about the attribute table of the Feature Layer
attributes = feature_layer.properties['fields']

# Define new attribute types to be used
new_types = {
    "realizace_do": "esriFieldTypeDate",
    # Continue with other attributes you want to modify
}

# Update the attribute types in the attribute table of the Feature Layer
for attribute in attributes:
    attribute_name = attribute['name']
    if attribute_name in new_types:
        attribute_type = new_types[attribute_name]
        attribute['type'] = attribute_type

feature_layer.manager.update_definition({'fields': attributes})&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 13 Jul 2023 13:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/issue-with-attribute-types-when-publishing-geojson/m-p/1307894#M53349</guid>
      <dc:creator>JiříKomínek</dc:creator>
      <dc:date>2023-07-13T13:28:04Z</dc:date>
    </item>
  </channel>
</rss>

