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!
- 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.
- 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.
- 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.
- 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.
- 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).
- Submit your mock inspection.
You are taken back to the details of the hydrant. - 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.
- Open ArcGIS Pro and start a new blank project.
- 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.
- 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:
- 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.
- 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.
- In your portal (ArcGIS Online or ArcGIS Enterprise portal), add the newly published layer to a new map.
- 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).
- 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 Optionsbutton 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.
- 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.
- Save all the changes you’ve made.
- 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.
Commenting is not enabled for this article.