Track feature layer request for "CreationDate" versus "created_date"

444
1
03-09-2020 09:18 AM
kmsmikrud
Occasional Contributor III

Hello,

I just noticed that in the tracks feature layer that is created in AGOL the fields for creator and editor are different from other AGOL feature layers that have editing enabled. We are running scripts to query feature layers by "CreationDate". I realize we can accommodate for this in the python code but it seems like a best practice for AGOL/ESRI to have the tracks feature layers follow the same naming convention as other AGOL data fields.

When you enable editing on AGOL feature layers the following fields are added:

  • CreationDate
  • Creator
  • EditDate
  • Editor

Tracker feature layers:

  • created_user
  • created_date
  • last_edited_user
  • last_edited_date

Is there any reason for the different naming conventions used in Tracker? Could these modified to be consistent with edited AGOL feature layers?

Thanks for your time,
Kathy

1 Reply
by Anonymous User
Not applicable

Those fields are specifically lower-cased so the location tracking schema can be consistent between ArcGIS Enterprise and ArcGIS Online. Different underlying databases have limitations/behaviors. For example PostgreSQL uses lowercase column names by default and this gets bubbled up through the REST API. If you add a field to a hosted layer on Enterprise, the field name will be lower-cased automatically. The location tracking service uses the lowest common denominator which is lowercase

Client apps and scripts need to account for this throughout the entire platform for any feature service. Each feature layer has a property called editFieldsInfo which defines the mapping of these field names. You should use that property as a look up table to figure out the names of the fields used for editor tracking. There are similar properties  for GlobalID and ObjectID field names. By leveraging these properties, apps and scripts will consistently work with the different feature layer implementations.

Here is an example for a random hosted layer in ArcGIS Online:

  "editFieldsInfo" : {     "creationDateField" : "CreationDate",      "creatorField" : "Creator",      "editDateField" : "EditDate",      "editorField" : "Editor"   }
Here is an example for the tracks layer:
"editFieldsInfo" : {     "creationDateField" : "created_date",      "creatorField" : "created_user",      "editDateField" : "last_edited_date",      "editorField" : "last_edited_user"   }, 


0 Kudos