Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to load "OBJECTID" argument dynamically #92

Open
cosbyr opened this issue Mar 13, 2018 · 0 comments
Open

Need to load "OBJECTID" argument dynamically #92

cosbyr opened this issue Mar 13, 2018 · 0 comments
Assignees

Comments

@cosbyr
Copy link
Contributor

cosbyr commented Mar 13, 2018

If the original parcels feature class already has an OBJECTID field, when the feature class is copied to the staging geodatabase in creates a new field called OBJECTID_1 which becomes the actual OBJECTID field. This causes an unsuccessful join in the lines below:

arcpy.JoinField_management(NEAR, "NEAR_FID", ParcelsFeatureClass, "OBJECTID", ParcelPIN)

arcpy.JoinField_management(NEAR, "NEAR_FID", ParcelsFeatureClass, "OBJECTID", ParcelPIN)

Fix is to get the OBJECTID field name from Describe object and pass that to the Join Field Argument

parcelOID = arcpy.Describe(ParcelFeatureClass).OIDFieldName

ParcelFeatureClass is the Parcels FC that is in the staged geodatabase already

@cosbyr cosbyr self-assigned this Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant