Symbolize newest survey123 attachment to collector

631
3
06-28-2018 12:12 PM
MattMulder
New Contributor III

Hi all,

I'm trying to symbolize a feature based on a survey123 attachment. I want to symbolize the feature based on a related table field, such as the completion/inspection date of the survey (so the feature would be symbolized based on a given timeframe). I also want it to use the "newest" survey to do this symbology. A feature is going to have multiple records of the surveys as attachments but I'd like to use the most recently completed survey to show where inspections have been done and where they haven't, essentially "overriding" the previous survey. Is this possible?

thanks

0 Kudos
3 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Matt,

Are you symbolizing this in ArcGIS Online/ArcGIS Enterprise's Map Viewer?  It's not possible to do this in that application at this time.

0 Kudos
MattMulder
New Contributor III

Hi James,

ya this is in ArcGIS Online. I was hoping to basically "automate" the symbology based on new entries rather than update a field in collector.

0 Kudos
TI
by
Occasional Contributor II

Hi Matt,

I have been struggling with this exact question for some time.  The solution that we are now running with may be of use if you haven't already solved this some other way.

Caveats:

  1. Your survey must submit data to your own local SDE enterprise geodatabase, not simply to ArcGIS Online - this requires a local ArcGIS Server, of course
  2. The map uses a map service or feature service that cannot have the 'sync' capability enabled, and therefore it will not work well offline (you can work around this to some extent, by panning/zooming to all the required areas to hold the map in temporary cache) - this is the primary drawback of this method!

Apart from those issues, this is working OK us so far.

The map is visible in Collector, and I can see which sites have been surveyed recently, and which are due for a survey, simply by the symbology.  The symbology should automatically update for the latest submitted survey data according to a configured refresh interval (if online) - however, I can't test this on my old version of Collector and my old iPad can't run the newer versions (it certainly works on that same map in the web browser).  For my old version of Collector, I can manually refresh the map to see the symbology update (switch to another map and then back again).

I can tap on an asset feature on the map, and in the pop-up, there is a link that I can tap on to automatically create a new survey for that feature in Survey123 with some fields already pre-populated (eg, AssetID).

Here's how I'm doing this:

  • Create a point feature class in your enterprise geodatabase (SDE) that will be used for your survey data and then share this to a feature service (or map service) with 'sync' capability (must have GlobalIDs and must have archiving enabled) - make sure it is secured as required.
  • In ArcGIS Online, add the feature service ('from the web') so that it can be use via ArcGIS Online as a proxy feature service - make sure that you save the credentials in ArcGIS Online when adding this feature service (as Survey123 can authenticate to ArcGIS Online, but it cannot authenticate to your ArcGIS Server) 
  • Using Survey123 Connect, generate a new survey based on the ArcGIS Online proxy feature service and configure the Survey as required - surveys will now submit data to your local SDE database instead of to ArcGIS Online (via the ArcGIS Online proxy feature service then through your local ArcGIS Server feature service)
  • Now create a view in your SDE using ArcGIS Desktop so that it combines data from your survey results with data from your pre-existing features (eg, your Assets feature class).  This view should use an SQL SELECT statement that results one record for each asset, and includes a column for the latest survey date (in my case, I also included a column for the number of days since the latest survey date, as this is easier to symbolise on later).  It should include the geometry, and OBJECTID of your assets at least, but I just included all of the asset fields.  NB:  Your query layer should use the versioned view in it's SQL, NOT the direct table (ie, usually just append '_EVW' to the table name).  My query layer SQL looks like this (I'm not a DBA, so it took me ages to get this right):
  • SELECT LastSurveyCaptureDate, DATEDIFF(day, LastSurveyCaptureDate, CURRENT_TIMESTAMP) AS DaysSinceLastSurvey, asset.* FROM [GIS_Ops].[gisadmin].[ASSET_EVW] AS asset LEFT OUTER JOIN (SELECT [Site], MAX(CaptureDate) AS LastSurveyCaptureDate FROM [GIS_Survey123].[gisadmin].[SURVEY_EVW] GROUP BY Site) AS survey ON asset.AssetID = survey.AssetID
  • Now add this view to your map - it will be created as a query layer on the map and you will have so specify which field to use as the ID field (select 'OBJECTID' for this).  Symbolise based on the date of last survey, or the number of days since the last survey.
  • Publish this as a second map service or feature service.  NB:  You will have to DEselect all options for the feature access apart from 'Query', as you cannot 'Update', 'Sync', 'Create', etc with a non-simple view (in this case the 'JOIN' makes in 'non-simple').  This is why this feature service cannot be used offline.
  • Now in ArcGIS Online, add this second service to a web map.
    • Configure the pop-up for this layer in the web map with a custom URL for 'arcgis-survey123://?itemID=xxxxxxxxx&field:AssetID=nnnnnn' or similar.  Then when users use this map in Collector, they can tap on an item that requires a survey, and then tap on the link to open a new survey in Survey123 with the AssetID question already filled in for them.  My Custom attribute display in my popup includes something like:<a href="arcgis-survey123://?itemID=f2b6d575e71947bcbc9b35c6ce8d6fd2&field:AssetID={AssetID}" target="_blank">Open a New '{AssetID}' Asset Survey in Survey123</a>
    • Configure a refresh interval for this layer (in my case, I set it to refresh every 15 min).  This will make sure that the symbology gets updated automatically to change dynamically with new survey data being submitted.  (It won't be real-time updates, but at least the symbology is never more than 15 minutes of of date.)

We are only in the early stages of running with this solution, but it's working OK so far.

(Note that I've used asset inspections as an example in the description above, but in reality, I'm using this technique for water quality testing at fixed testing sites, not for asset inspections.  I just figured that asset inspections is something people are more likely to be able to relate to.  If the operators are happy with this for water testing for a few months, I plan to implement similar solutions for meter reading and for compliance audits.)

Cheers,

Nik.

0 Kudos