Editor Tracking

2023
1
05-09-2018 10:57 AM
Kane_Nate
New Contributor

Two editor tracking problems in ArcGIS Online and/or Collector

The edit tracking tools seem to have changed. (We used “Enable editing”, “Keep track of created and updated features”, “Keep track of who created and last updated features”, and “enable Sync”).  Here are the issues:

  1. When entering edit mode in Collector, a dropdown list now appears for the user to choose who will edit. It used to be that the editor (by default) was the user signed-in to Collector. This shouldn’t be an option for the user.
  2. With the edit tracking enabled in the database, the attributes do not maintain who edited in the database when sharing to the new Feature Layer. It populates the column with my name and the current date.

The situation

  • We are using the “Collector” app to allow users to edit/create point data in the field.
  • In 2017, we created a (hosted) Feature Layer using a geodatabase with domains, attachments, and edit tracking. It was used in summer 2017 and it worked well.
  • In preparation for the 2018 collection, we changed an attribute’s domain values and added an attribute to the database and now want to make a new Feature Layer with these updates for the 2018 collection season. We want to maintain the edit tracking from the original feature layer (usernames and dates), and track editing again this year.
  • We publish using AcrGIS 10.4 Desktop, and Collector on an iPad (iOS version 11.3.1).
0 Kudos
1 Reply

I had a problem with retaining edit tracking for hosted feature services upon republishing.  I use an XML Geodatabase modeling tool (Sparx EA) to make geodatabse model updates, and python to stage the data, actually a jupyter notebook.  

first I do something like this:

#add edit tracking to all the feature classes AND DISABLE EDIT TRACKING
from arcpy import ListFeatureClasses, ListDatasets, EnableEditorTracking_management, DisableEditorTracking_management, env
#NewDatabase = r'c:\temp\CollectorGDB_2018081502.gdb'
env.workspace = NewDatabase
print (env.workspace)
datasets = ListDatasets()
for ds in datasets:
 for fc in ListFeatureClasses(feature_dataset=ds):
 print ('adding Edit tracking fields added for {0}'.format(fc))
 EnableEditorTracking_management(fc, "Creator", "CreationDate", "Editor", "EditDate", "ADD_FIELDS", "UTC")
 DisableEditorTracking_management(fc)
 print ('Edit tracking fields added and disabled for {0}'.format(fc))

Then I do this to keep records of previous edit tracking fields 

#add edit tracking to all the feature classes AND DISABLE EDIT TRACKING

from arcpy import ListFeatureClasses, ListDatasets, EnableEditorTracking_management, DisableEditorTracking_management, env

#NewDatabase = r'c:\temp\CollectorGDB_2018081502.gdb'

env.workspace = NewDatabase
print (env.workspace)

datasets = ListDatasets()
for ds in datasets:
    for fc in ListFeatureClasses(feature_dataset=ds):
        print ('adding Edit tracking fields added for {0}'.format(fc))
        EnableEditorTracking_management(fc, "Creator2018", "CreationDate2018", "Editor2018", "EditDate2018", "ADD_FIELDS", "UTC")
        DisableEditorTracking_management(fc)
        print ('Edit tracking fields added and disabled for {0}'.format(fc))

then I do lots of other stuff to download and append and stage the updates, then I do these steps:

#back calculate edit tracking to static fields
from arcpy import ListFeatureClasses, ListDatasets, env, ListFields
from arcpy.management import CalculateField
#NewDatabase = r'C:\temp\CollectorGDB_2018081502.gdb'
env.workspace = NewDatabase
print (env.workspace)
datasets = ListDatasets()
for ds in datasets:
 print (ds)
 for fc in ListFeatureClasses(feature_dataset=ds):
 print (ds, fc)
 CalculateField(fc, "Creator2018", "!Creator!", "PYTHON3", None)
 CalculateField(fc, "CreationDate2018", "!CreationDate!", "PYTHON3", None)
 CalculateField(fc, "Editor2018", "!Editor!", "PYTHON3", None)
 CalculateField(fc, "EditDate2018", "!EditDate!", "PYTHON3", None)

this step moves the appended, historical edit tracking to my last year/historical edit tracking, not managed by Esri.

Then I enable edit tracking back on the original edit tracking fields:

#RE-ENABLE EDIT TRACKING with EDIT TRACKING HISTORY
#arcpy.EnableEditorTracking_management("C:\\gisdata\\Railroads\\CollectorGDB_2018080203.gdb\\Railroad\\MastCrossbuckAssembly", "Creator", "CreationDate", "Editor", "EditDate", "NO_ADD_FIELDS", "UTC")
from arcpy import ListFeatureClasses, ListDatasets, EnableEditorTracking_management, DisableEditorTracking_management, env
#NewDatabase = r'C:\gisdata\Railroads\CollectorGDB_2018080203.gdb'
env.workspace = NewDatabase
print (env.workspace)
datasets = ListDatasets()
for ds in datasets:
 for fc in ListFeatureClasses(feature_dataset=ds):
 print('enable new edit tracking data to fields in {0}'.format(fc))
 EnableEditorTracking_management(fc, "Creator", "CreationDate", "Editor", "EditDate", "NO_ADD_FIELDS", "UTC")
0 Kudos