Inspecting with Collector for ArcGIS

3089
10
11-07-2017 09:01 AM
Kylie
by Esri Regular Contributor
Esri Regular Contributor
4 10 3,089

We often talk about how easy it is to collect data using Collector. But Collector participates in two major workflows: data collection (and building your own asset repository) and inspection (and knowing the state of each asset in that repository). Here I want to talk about inspections. First, let’s see how you can complete an inspection in Collector. Then I’ll talk about how the data was set up and how the map was made.

Inspect a hydrant

Use a Try it map in Collector to do an inspection yourself. Let’s pretend we are firefighters in Naperville, IL, and need to inspect fire hydrants. The last thing we want is to find out one isn’t functional because we need it!

  1. Open Collector and select Try it (iOS and Android) or Try Collector (Windows). You don’t need to sign in to use some sample maps and try out the UI for yourself.
  2. From the list of maps, select Hydrant Inspections.

    The map opens, and since I gave the app permission to use my location, the app zooms to where I am. If you’ve played with Collector before, you might notice that there isn’t a button to create a new feature! That’s OK, in this map, our inspections are going to be associated with features already there. We won’t be creating new features.
  3. Since we aren’t creating features, we need to go to where they are. Search for Naperville, IL, and you’ll see the hydrants. Or use the bookmark for the default map extent to see them.

    Select one of the hydrants (which one doesn’t matter) and see some information about it, including its identifier, last service date, and if it is operable. We’ll pretend that is the hydrant we are inspecting.

    Since we are doing an inspection, and not doing servicing or changing anything, we don’t want to change the details (attributes) of the hydrant itself. Instead, we’ll log a report. Inspections can be important over time, so we want to allow the hydrant to have multiple such reports. At the bottom of the details, there is an Inspection section with options for View and New.
  4. Select New to add your report. A form opens, prompting you for the information you’d want to report while doing your inspection. For example, if it needs paint, or draining, you can submit that information here.
  5. For this inspection, we want to be sure to include a photo of the hydrant’s current state. Take and attach a photo using the attachments button (a camera on iOS and Windows, and a paperclip on Android).
     
  6. Submit your mock inspection.
    You are taken back to the details of the hydrant.
  7. Select View in the Inspections part of the details, and you’ll see your new inspection is associated with your hydrant. If other inspections of the same hydrant have been done, you see them as well.

The data

Key to the inspection workflow is how multiple inspections are all tied to a single hydrant. They can share many of the details of the hydrant, such as its identifier, location, and manufacturer. But each inspection is also important in and of itself, and the latest one shouldn’t replace the details about the one before it. To achieve this structure, the hydrants are a feature class and the inspections are a related table—since the inspections don’t have a location separate from that of the hydrants, they don’t need to be spatial. The feature class and the related table have what is known as a one-to-many relationship: one hydrant can be associated with multiple inspections. But each inspection is only associated with a single hydrant.

There is a solution that gets us started. Download the Hydrant Maintenance Inspection Solution, and unzip it on your computer. That solution is built for ArcMap, and instead today we’re going to use that same data but work in ArcGIS Pro. By using the data, we’ll start with a database already populated with hydrants. If doing this for your own city, you could clear those out and start by collecting your city’s fire hydrants. Here we’re going to jump right to inspecting, though.

  1. Open ArcGIS Pro and start a new blank project.
  2. In the Contents pane, right-click Databases and select Add Database. Browse to the database you extracted from the solution, and add it to the project.
  3. In the Catalog pane, expand the HydrantMaintenanceInspections.gdb that you just added. It has three components, and hovering over each one tells a little about it:
  4. Open the properties of the components, and explore them a bit. Here are some things we’ll be able to learn:
    • The HydrantToInspection relationship class is one-to-many.
    • Hydrants are the origin, and the inspections are the destinations.
    • A primary and foreign key are used to associate hydrants with inspections.
    Tip: To learn more about relationships and setting them up, see Relationships and ArcGIS.
  5. We want to use Collector with this data, so it needs to be available either through ArcGIS Online or ArcGIS Enterprise. To get it there, publish your data. We need to do the following to publish it:
    • Add the hydrants layer and the inspection table to a map in ArcGIS Pro (Add a new map and drag and drop the layer and table onto it).
    • (optional) Fix the layer’s symbology. I used “Cross 3” (double-click the existing symbol in Contents, then search for and select “Cross 3” in the Symbology pane).
    • (optional) Add an inspection date into the HydrantMaintenanceInspection table (right-click the Hydrant Maintenance Table, select Open, and add a field). It is common to want to track when inspections were done and in this blog we’ll use the date when presenting the information in Collector.
    • (optional) If you’d like to attach images during your inspection, enable attachments on the Hydrant Maintenance Inspection table (use the Enable Attachments tool).
    • Share your layer as a web layer (Go to the Share ribbon and in the Share As group select Web Layer). You’ll need to be logged in to your ArcGIS organization. Make sure you leave the Layer Type set to Feature, and in Configuration, enable editing. If you want to use your map offline, enable sync as well.
    • Publish your layer.

The map

Collector works with web maps. So once we have our feature class and related table available in ArcGIS Online or ArcGIS Enterprise, we need to add them to a web map.

  1. In your portal (ArcGIS Online or ArcGIS Enterprise portal), add the newly published layer to a new map.
  2. We don’t want inspectors to be changing the hydrants themselves, so disable editing on the hydrant features (click More Options for the layer and select Disable Editing).
  3. The hydrant features are how we’ll access our inspections. We’ll use most of the defaults for the hydrant pop-up, but we do want to configure it so that the inspections show with newest inspections first. Make sure you are configuring the pop-up for the hydrants (features), not the inspections (in the table), and use the Sort Options button at the bottom of the Configure Pop-up pane.

    If we wanted, we could further customize the pop-up in the map. Be careful: if you disable Show related data you won’t be able to add or view inspections on your hydrants.
  4. In the hydrant pop-up, the title from the inspection pop-up is used when showing the related inspections. Let’s configure the title of the inspection (table) pop-up to have some meaningful information like the inspection date and inspector.

    We could further customize this pop-up, as well. Doing so would customize the inspection form filled out in Collector.
  5. Save all the changes you’ve made.
  6. Open the map in Collector. The functionality of the map we just created matches that of the one we explored earlier in this blog.  

Now you've used related records to capture inspection data in Collector, and even set up the data and map yourself. We stayed connected, but you could use this same map offline as well. If your company does inspections, now you can now bring those inspection workflows into Collector.

10 Comments
ZoltanKelly1
New Contributor II

Hi Kylie Donia,

This map is visible as one of the demo maps available in both the old and new Collector iOS apps (by clicking 'Try It') instead of logging in.

This has a layer (Inspected_Hydrant) in it that shows highlighted inspections when a related record is populated. These change instantly as soon as a record is populated.
How is this layer configured - Can this configuration be shared? (either as info, or a link to that webmap on ArcGIS Online).

I can create equivalent functionality with a joined hosted view in ArcGIS Online to the inspections table, but it requires a refresh or at least a redraw for the symbology to change. I haven't tried a database level view joined and published via ArcServer if that would make a difference, but it would be preferable if it didn't require exposure of ArcServer externally.

See below for screencaps, if you add a related record it gets highlighted in green

Hydrant Survey - inspected records on map

You can see in the layers it’s a separate layer:

Hydrant Survey - inspected records as separate layer
Thanks!

Zoltan

Kylie
by Esri Regular Contributor
Esri Regular Contributor

This is done with a Join view (joining the hydrants and the related records) that is added to the map and symbolized (in this case, as a green circle) and has a refresh interval. This sounds like what you are doing, but the one thing that might be missing is we set a refresh interval of .1 minutes on the join layer -- this is how it appears so quickly when an inspection is added.

Keep in mind that using a join view won't work offline - since the "Try it" maps doesn't support offline use, that was ok for our example.

ZoltanKelly1
New Contributor II

Brilliant! Thanks for the reply, appreciate it.

Regards

Zoltan

MichelleDuncan2
New Contributor III

Update to below question:

The Join View layer isn't working in the new Collector but does in the Classic. I get an error in the new Collector that says: Layer failed to load. Any ideas why?

Original Question:

We have inspections that we do on a monthly basis that I'd like to use this join view on. Sorry if I'm missing the obvious but if all the inspections are in one related table how do you reset the layer back to show the features as uninspected or without the green circle so that the inspection process can start over again.

Thanks,

Michelle

by Anonymous User
Not applicable

Hi, I have a few questions about issues I ran into when creating my own version of the Hydrant inspection with collector. My first issue is that when I am in Collector and complete the fields in the Inspection form, when I click "Submit" I get an error that says "The data types are not compatible" and am unable to submit the inspection. 

My second question is about configuring the Collector application. In this tutorial, I like how the popup has View and New options available under the Inspection heading. How did you configure that? Was that only available in the old Collector?

Thank you, 

Anna 

KellyArmstrong
Occasional Contributor II

So, you can only select one feature at a time to add one inspection at a time?  If I need to select 1500 hydrants to add the same inspection to them all, I have to repeat this step 1500 times???

Kylie
by Esri Regular Contributor
Esri Regular Contributor

Hi Kelly -- As Collector is designed to be a field app, it is focused on inspections that are done in the field. In your case, yes, you'd have to do the steps many times, and Collector probably wouldn't be your best solution. However, if this is something you'd like to see for related records, please submit an Idea. Thanks!

Kylie
by Esri Regular Contributor
Esri Regular Contributor

Hi Anna Wegbreit sorry for my delayed reply! 

For the error you are getting, did you create your data following this tutorial, or a different way?

Those options were in the old Collector -- the UI has changed in the latest version.

MichelleDuncan2
New Contributor III

The idea is a great one and has already been submitted by someone else a couple years back. You can go to this link and vote it up. Add Multiple Related Records 

by Anonymous User
Not applicable

This is a really helpful blog thanks for writing it. 

About the Author
Our kids need GIS in their problem-solving toolboxes. I'm working to get digital maps into each K-12 classroom and the hands of each child. A long-time Esri employee, I've previously worked on Esri's mobile apps, focused on documentation and best practices. Out of the office I'm a runner often found on the trails or chasing my children.