AnsweredAssumed Answered

ArcGIS REST API Add Features with Editor Tracking Disabled

Question asked by smithc on Nov 2, 2016
Latest reply on Nov 3, 2016 by smithc

Background

 

We have a growing number of Survey 123 apps that are published to our Portal (10.3.1) with associated Hosted Feature services. As time goes on requirements for changes (new fields) to the surveys become apparent which requires creating a new instance of the survey with a new hosted feature service. What we want to be able to do is push the data from the old survey feature service to the new survey feature service including persisting the editor tracking data.

 

Methodology

 

We have decided to use python and the ArcGIS Rest API with the following methodology:

  1. Use "Query" to read the features form the OLD hosted feature service
  2. Use "AddFeatures" to write the features to the NEW hosted feature service

 

In theory the data from all matching fields will be copied over and any new fields in the new hosted feature service will not be populated.

 

The Problem

 

In essence the above methodology works fine. The problem however is with the Editor Tracking fields 

  • created_user ( alias: created_user , length: 255 , nullable: true , type: esriFieldTypeString , editable: false )
  • created_date ( alias: created_date , length: 29 , nullable: true , type: esriFieldTypeDate , editable: false )
  • last_edited_user ( alias: last_edited_user , length: 255 , nullable: true , type: esriFieldTypeString , editable: false )
  • last_edited_date ( alias: last_edited_date , length: 29 , nullable: true , type: esriFieldTypeDate , editable: false )

We want the data in the editor tracking fields in the old service written to the new service

 

If we leave editor tracking enabled and run the script to copy the data from the old service to the new service the editor fields are populated with the current user and date/time as when the script was run.

 

If we disable editor tracking the editor tracking fields are not populated at all??

 

I can see the editor tracking fields in the json returned by the "Query" request and this is being passed to the "AddFeatures" request. The data is not populated in the new service but all other data is?

 

Is there a way to populate editor tracking fields in a hosted feature service with data other than have them automatically populate with current user current date/time etc?

 

If anybody has come across this issue and has a valid solution that would be much appreciated.

 

cheers

 

Callum

Outcomes