Select to view content in your preferred language

Capturing multiple related records for a single point geometry using mobile application for field inspections

1676
1
09-22-2024 08:00 AM
prasanthkrishnavarman
New Contributor

Hello, I conduct frequent field inspections for Weights and Measures, recording multiple test results at the same location. We have InspectionSites (geopoint) where multiple related ScaleTests (nested table) need to be recorded frequently. Currently, for each test entry, users have to relaunch the form from the web app, making the process slow and inefficient.

How can I streamline data collection for ongoing field inspections of multiple related tests at the same location using Survey123, avoiding the repeated form launches required in the standard web application setup?

0 Kudos
1 Reply
NandhiniR
Esri Contributor

In scenarios involving field inspections where multiple tests need to be recorded, the recommended approach involves using Survey123's repeat functionality along with URL parameters to edit related tables directly from the web application while preserving the parent layer.

Steps to achieve the workflow:

  1. Identify the Feature Class and Related Tables: The main feature class (InspectionSites) holds spatial locations of inspection sites. Related tables (ScaleTests) store information on tests conducted at these locations. These tables are related through fields such as GlobalID.
  2. Configure Survey123 Form with Repeats: Design the Survey123 form to include repeat sections for related tables like ScaleTests. Ensure the form_id points to the feature class (InspectionSites) and the submission_url is updated accordingly in the XLSForm's Settings tab. This setup allows multiple test entries within the same form.
  3. Set up the URL Parameters as an Expression in the Web-App's Pop-Up: In the map linked to the web application, use URL parameters to set up the Survey123 form to launch in edit mode directly from the web app, pre-filled with data from the existing records. To do so, define an expression with the following script, and later embed it into the map's pop-up configuration:
var urlsource = 'arcgis-survey123://?';
var params = {
  itemID: '5abd60afec24471f93cb4cc971357f6a', // Survey123 Form Item ID
  'field:Name': $feature.Name,               // Populate with the related feature's name
  action: 'edit',      // Set the form to edit mode
  update: true,       // Enable update mode for related records
  filter: 'field:GlobalID:' + $feature.GlobalID, // Filter to match the correct record based on GlobalID
  q: 'where=GlobalID=' + $feature.GlobalID   // Query string to target the exact record
};
return urlsource + UrlEncode(params);

This URL will open the form with the current inspection data, allowing multiple entries to be captured in one session. [Note: As improper URL formatting may cause the Survey123 app to run into hiccups, encoding is a safe bet]

You may proceed to conduct field tests to ensure that the form behaves as expected: launches correctly, allows repeated entries, and saves updates to the related table without error. With the expected workflow, the Field Collection process would be simplified by enabling repeated capture of information via related table for selected location.