Select to view content in your preferred language

Track When Field Maps Offline Data Is Synced

67
3
9 hours ago
JesseSchewe_mnr
New Contributor

Hi,

In my organization, we rely heavily on Field Maps and collect data almost entirely on offline map areas. In a given day, we have multiple users in the field collecting geometry (points, lines, polygons) on the same offline map area. However, at the end of some days, our field users forget to sync their offline map areas to put the data that they collected into the online web map. When performing data QA/QC the next day in the office, it can be hard to tell why a field user doesn't have data for the previous day -- did they just not find anything, or did they forget to sync?

Is there a way to track or a log that can be enabled or viewed or that shows when Field Maps users have synced to either a specific offline map area or any offline map area associated with a web map?

Thanks

0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

I have this script that works.  Gives user, last sync, etc.  I use it to find old replicas to delete since Field Maps has a bug for some time now where any replica removed while offline gets orphaned.

Just make sure Pro is logged in.  Does not have to be open just in.  

Hope that helps

import arcpy
from arcgis.gis import GIS
import arcgis
from arcgis.features import FeatureLayerCollection

gis = GIS('pro')

#gis = arcgis.GIS(profile_name=profile)
#itemID of service
itemID = "acbb9fa63afdafc9fsd0b16"


item = gis.content.get(itemID)
flc = FeatureLayerCollection.fromitem(item)
replicas = flc.replicas.get_list()
print ("ReplicaOwner,ReplicaName,ReplicaID,CreateDate,LastSyncDate")
for r in replicas:
    replica = flc.replicas.get(r['replicaID'])
    create_date = datetime.datetime.fromtimestamp(replica['creationDate'] / 1000)
    last_sync_date = 'n/a' # don't trust this to always be populated
    if type(replica['lastSyncDate']) is int:
        last_sync_date = datetime.datetime.fromtimestamp(replica['lastSyncDate'] / 1000)

 

JesseSchewe_mnr
New Contributor

Hi Doug,

Thank you for your response! This sounds like it would be helpful. I have a few questions.

  • Where is it that you are running this script?
  • What are replicas in this instance?
  • Our maps are composed of ArcGIS Online hosted feature layers, and we do not use ArcGIS Enterprise. Does that have any bearing on this matter?

I'm still getting used to the online Arc environment and all help is appreciated!

Thanks

DougBrowning
MVP Esteemed Contributor

I use this for AGOL services so it should work fine.

You will need ArcPro installed and logged into AGOL.

Get a Python editor - I use PyScripter.

Change the itemid to that of your service.   Get this from the AGOL page.

Run it

You can also view this manually by going to the item page of the service.  Then bottom right you will see a link to the REST service page.  Click that and it opens a text based interface.  Look for Replicas at the bottom and in there you can get a list.  Replicas are what Arc uses to checkout data onto the tablet.

What you are asking is a bit advanced but you should see it if you poke around.

Hope that helps

0 Kudos