Select to view content in your preferred language

Map Layer Failed to Load (3047 duplicate field) - Inspection Workflows and Join Features layer

3570
19
04-06-2022 10:58 AM
BrennanSmith1
Regular Contributor

I am following the instructions in ESRI's Inspection Workflows YouTube video series.  I am using ArcGIS Pro 2.9 and Enterprise Portal 10.9.  My 'Join Features' layer is functioning correctly in the webmap, but will not load in Field Maps, with the following error:

Map: Hydrant Inspections Webmap
Layer: Recent_Hydrant_Inspections
Domain: ARCGIS_RUNTIME
Code: 3047
Description: Geodatabase duplicate field not allowed.

The issue is that both the feature layer (Hydrants) and related table (Inspections) contain a GlobalID field. When I perform a Join Features (so we can symbolize on most recent inspection), the resulting layer contains two GlobalID fields named 'globalid' and 'globalid_1649266887779'.  I can't find any way to remove one of these fields or resolve the issue.

How is it possible to view a 'Join Features' layer in Field Maps? Why did it work in Eric's demo but not in my environment?

 

0 Kudos
19 Replies
SebFischer
Emerging Contributor

This is still relevant - I am running into the same problem trying to set up an inspection workflow in ArcGIS Enterprise 11.1. 

It seems to me that if you don't need offline capabilities you can set up your related tables without a GlobalID field to avoid this error. But if your workflow requires the related tables to be part of an Offline Map Area in FieldMap then the GlobalIDs are required and you can't add a Joined Hosted Feature Layer View to the Fieldmap because of the mentioned BUG. 

 

Edit: GlobalIDs are also required for Synchronization capabilities

Bertodiem
Emerging Contributor

I just posted a workaround. Regards

0 Kudos
BrennanSmith1
Regular Contributor

Sorry to see so many others having this issue still. We recently updated to enterprise 11.3 and the issue is not resolved, and the bug is still 'Under Consideration'. I'm hopeful that taking the entire dataset out of hosted feature layers and into an enterprise gdb with views will let me get the functionality. I will report back if I ever get something working. In the meantime, here's an very stripped down example script you can run to populate a recent inspection date field in the hosted feature layer. 

 

 

import arcpy

# sign into portal
arcpy.SignInToPortal(r"https://portalURL",'username', 'password')
arcpy.env.addOutputsToMap = False

# Load in related table
related_table  = arcpy.management.MakeTableView(r"URL-to-rest-services/FeatureServer/1",'related_table')

# Loop through and populate dictionaries of most recent inspection date
# Update inspectiondate field name as needed
d_recent   = {}
with arcpy.da.SearchCursor(related_table,['globalid','inspectiondate'],sql_clause=(None, "ORDER BY inspectiondate DESC")) as cursor:
    for row in cursor:
        # add to dict for most recent insp only
        if row[0] not in d_recent.keys():
            d_recent[row[0]] = row[1]

# get only features that have related records
guids = list(d_recent.keys())
query = "GlobalID IN ({:s})".format(','.join(f"'{x}'" for x in guids))
features  = arcpy.management.MakeFeatureLayer(r"URL-to-rest-services/FeatureServer/0",'features',query)

# loop through and update
with arcpy.da.UpdateCursor(features,['globalid','recent_insp_date']) as cursor:
    for row in cursor:
        if row[1] != d_recent[row[0]]:
            print('Feature {} recently inspected on {}'.format(row[0],d_recent[row[0]]))
            row[1] = d_recent[row[0]]
            cursor.updateRow(row)

 

 

 

dolson_farmington
Occasional Contributor

It is odd to me that this is still an issue with no straightforward workaround years later. How are other agencies able to create a survey that requires a one to many relationship where Supports applyEdits with GlobalIDs' is True (i.e. literally any dataset that needs routine inspection or maintenance....trees, catch basins, storm ponds, outfalls, etc etc etc etc)? 

Am I missing something? Isn't this a basic necessity for any business/government conducting repeated surveys on static features? 

Had a support call in which I was told there wasn't a way around it, but that it doesn't appear to be an issue in ArcGIS Online. For the amount we pay for Enterprise, this functionality should be one of the more basic requirements.  

Bertodiem
Emerging Contributor

I just posted a workaround. Regards

0 Kudos
PTW
by
Regular Contributor

I am also running into this problem and I would like to find a solution. I had everything working with AGOL however after switching to Enterprise I am now receiving the error message:

Domain: com.esri.arcgis.runtime.error Code: 3047 Description: Geodatabase duplicate field not allowed.

Bertodiem
Emerging Contributor

I just posted a workaround. Regards

0 Kudos
Bertodiem
Emerging Contributor

I reported this bug two years ago in version 10.9. and it is frustrating that in 11.3 this bug is still present.

0 Kudos
Bertodiem
Emerging Contributor
 
Here are the steps we followed to resolve the issue:
 
1. Access the rest endpoint of the join hosted feature layer view in Portal for ArcGIS : First, navigate to the Portal for ArcGIS and open the hosted view layer that is causing the problem. Modify the rest URL adding the word "admin". (Example show below)
              
              Bertodiem_0-1742591852607.png

 

2. Update Service Definition : Edit the join features service definition configuration to ensure there are no duplicate field names. This step is crucial as the error message "Geodatabase duplicate field not allowed" is triggered by these duplicates. You should change the visible variable to false and name the globalid field of the related table that repeats. There should only be one globalid field in the definition file.
 
Bertodiem_1-1742591852612.png
3. Save Changes: After making the necessary adjustments, save the changes and refresh the hosted view layer
4. Test in Field Maps: Open ArcGIS Field Maps and load the hosted view layer. You should now be able to access the layer without encountering the error message.
 
Bertodiem_2-1742591852616.png

 

BrennanSmith1
Regular Contributor

Thank you @Bertodiem for this workaround! I haven't deployed it with my main app yet, but it did work in my testing environment.  To clarify what you said for others who may have less experience using this approach:

  • Make sure you are at the URL of the layer and not the feature server.  The layer URL will end in "/0". It will look something like this, where the red text is specific to your configuration.
    • https://enterprisedomain.org/servername/rest/services/Hosted/JoinFeaturesName/FeatureServer/0
  • Insert "admin" into the URL between rest and services
    • https://enterprisedomain.org/servername/rest/admin/services/Hosted/JoinFeaturesName/FeatureServer/0
  • Scroll down and make note of the second globalid field, the one with a bunch of random numbers at the end. I believe it will always be the second-to-last field. In my case it was "globalid_1649266887779".
  • At the bottom of the page, click the Update Definition hyperlink
  • Change the format to JSON.  Use the following text as input, updating the globalid field to match yours
{
    "fields":[
        {
            "visible":false,
            "name":"globalid_1649266887779"
        }
    ]
}
  •  Click the updateDefiniton button. You will hopefully see "success": true

 

Note that if you are using this globalid field for other applications (e.g., a dashboard where you use this field to count unique entries), it might break something, I haven't looked into that yet.