curly brackets in GUID

2198
4
02-22-2020 08:00 AM
DanielSørensen
New Contributor II

Hi, 

When importing data from a PostgreSQL database into ArcGIS Pro, the UUID from PostgreSQL are transformed into GUIDs, and for some reason the GUID contains curly brackets in the begnning and end, as showend below:

Do you guys know how to avoid that? Or, how to remove the curly brackets? 

0 Kudos
4 Replies
DavidPike
MVP Frequent Contributor

Hi, completely unsure of the reason but a quick fix in field calculator would be:

set it to python on the radio button and click 'show codeblock' put this in the pre-logic script code :

def curly(field):
    field = field.replace("{","")
    field = field.replace("}","")
    return field

then type into the codeblock at the bottom (below 'my field =')

curly(the name of your field enclosed within ! !)

e.g.

curly(!GUID!)

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

The most important statement you made is, "when importing..."  I am guessing your field type in Pro will show as GUID.  If so, you can't just remove the curly brackets.  How are you importing the data?

DanielSørensen
New Contributor II

Hi, I add data as a query layer and export features into a geodatabase, and yes, the field type in Pro are showing GUID. Maybe this field type, will always include curly brackets?  

0 Kudos
DanPatterson_Retired
MVP Emeritus

perhaps the opening paragraphs here might explain why the field appears to change

ArcGIS field data types—Geodatabases | Documentation 

and the section on Global Identifier section.