<?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 Re: Inconsistency of Global ID Column in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080981#M6377</link>
    <description>&lt;P&gt;To complement Hamish's answer, if you simply wanted to know the globalid field, you could do so like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import pandas as pd
from arcgis import GIS
from arcgis.features import FeatureLayer

gis = GIS("your_org_url", "username", "password")
fl_url = "whatever/your/url/is/0"
fl= FeatureLayer(table_url, gis=gis)
globalid_field = fl.properties.globalIdField if hasattr(self.properties, "globalIdField") else None

query_results =  fl.query()
sdf = query_results.sdf
# Do something with sdf[globalid_field]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;I don't know about you, but I often need to know the globalid field without hardcoding a value so as to make scripts more versatile. If that's what' you're after I think this logic will be useful to you.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Tue, 20 Jul 2021 19:14:11 GMT</pubDate>
    <dc:creator>emedina</dc:creator>
    <dc:date>2021-07-20T19:14:11Z</dc:date>
    <item>
      <title>Inconsistency of Global ID Column</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080727#M6374</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;Does anyone have any issue with inconsistency in global id field name when using geoaccessor in python AP? I am using it for converting a feature class to dataframe and the global id field name randomly changes (either 'globalid', 'GlobalID', or 'global_id'.&lt;BR /&gt;&lt;BR /&gt;Please share if you have some configurations or workaround to prevent this from happening.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Naufal&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 09:02:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080727#M6374</guid>
      <dc:creator>MuhammadNaufalIhsan</dc:creator>
      <dc:date>2021-07-20T09:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency of Global ID Column</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080741#M6375</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/426357"&gt;@MuhammadNaufalIhsan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Have you checked the name of your global ID field in the feature layers/tables that you are reading into a dataframe?&lt;/P&gt;&lt;P&gt;I have seen this before, but it turned out to be the case that my field names were actually different to begin with. As a workaround, perhaps you could try the following:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from arcgis.gis import GIS
from arcgis.features import GeoAccessor
import pandas as pd

gis = GIS("home")

item = gis.content.get("&amp;lt;itemid&amp;gt;")
flayer = item.layers[0]

sedf = pd.DataFrame.spatial.from_layer(flayer)

for column in sedf:
    if column == 'globalid':
        sedf = sedf.rename(columns={'globalid': 'GlobalID'})
    elif column == 'global_id':
        sedf = sedf.rename(columns={'global_id': 'GlobalID'})

sedf&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 09:28:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080741#M6375</guid>
      <dc:creator>HamishMorton</dc:creator>
      <dc:date>2021-07-20T09:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency of Global ID Column</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080981#M6377</link>
      <description>&lt;P&gt;To complement Hamish's answer, if you simply wanted to know the globalid field, you could do so like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import pandas as pd
from arcgis import GIS
from arcgis.features import FeatureLayer

gis = GIS("your_org_url", "username", "password")
fl_url = "whatever/your/url/is/0"
fl= FeatureLayer(table_url, gis=gis)
globalid_field = fl.properties.globalIdField if hasattr(self.properties, "globalIdField") else None

query_results =  fl.query()
sdf = query_results.sdf
# Do something with sdf[globalid_field]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;I don't know about you, but I often need to know the globalid field without hardcoding a value so as to make scripts more versatile. If that's what' you're after I think this logic will be useful to you.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Jul 2021 19:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1080981#M6377</guid>
      <dc:creator>emedina</dc:creator>
      <dc:date>2021-07-20T19:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistency of Global ID Column</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1081633#M6383</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/238758"&gt;@HamishMorton&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for your response. Yes, I've checked the name of the field (it is 'globalid'). I've run the tools on pro and it is going well. But once I've published to GP service and run it on web app, it shows an error that says "key 'globalid' does not exist." When I troubleshoot the problem, it turns out the name sometimes changes to either 'global_id' or 'GlobalID.'&lt;BR /&gt;&lt;BR /&gt;So far, I force the field name to change to 'globalid' in pandas as a workaround. But I've just wondered whether this is a common problem or not.&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;Naufal&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 07:07:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/inconsistency-of-global-id-column/m-p/1081633#M6383</guid>
      <dc:creator>MuhammadNaufalIhsan</dc:creator>
      <dc:date>2021-07-22T07:07:09Z</dc:date>
    </item>
  </channel>
</rss>

