Select to view content in your preferred language

I am wanting users to be able to click a polygon and perform a survey on it, can Survey123 do this?

156
3
a month ago
schulte_a
New Contributor

I am wanting to have auditors go to every room in our buildings and perform a survey on it. Is it possible if I create a webmap with our rooms polygon layer on it, the end user can click each polygon, be prompted to perform the Survey123 survey on it, then once the survey is completed the room will change to a different color?

 

Is this a difficult path to follow?

0 Kudos
3 Replies
MobiusSnake
MVP Regular Contributor

It's possible to launch Survey123 from a pop-up in Field Maps, if you search for "Field Maps Survey123 integration" you should be able to find some examples on here.  I don't think it's possible to update an attribute value on the polygon feature just from S123 form completion however, the user would need to update an attribute on the polygon feature manually when they're done.

Edit to add - You can pass attributes from the polygon feature to Survey123 with this approach, so if the room has an ID on it, that ID can be passed to the survey as a read-only attribute.

RyanUthoff
MVP Regular Contributor

I think there are a couple ways that you could update the attribute value on the polygon layer from S123. You could have an ETL process that updates the polygon layer based on the data provided in the S123 layer. So, the ETL would read the S123 data, and then update the polygon layer attribute where the room ID matches between the two. But, the polygon attribute would not immediately change when a survey is submitted. That would be best suited for a nightly ETL or something.

Alternatively, you might be able to use webhooks that triggers a process (such as the ETL) to run immediately when a survey is submitted that updates the polygon. 

SpatialCadet
Occasional Contributor

I have done something similar with points, dynamic url to call survey123 app from Fieldmaps looks something like this to pass geometry/attributes to the form. Can add call-back parameters to url if needed. 
Example:

// Define the WebMercatorToWGS84 function
function WebMercatorToWGS84(x, y) {
    var PI = 3.141592653589793;
    var lon = (x / 20037508.34) * 180;
    var lat = (y / 20037508.34) * 180;
    lat = 180 / PI * (2 * ATan(Exp(lat * PI / 180)) - PI / 2);

    return {
        y: lat,
        x: lon
    };
}

// Base URL
var urlsource = 'arcgis-survey123://?';

//get geo, transform
var geom = Geometry($feature);
var coords = WebMercatorToWGS84(geom.x, geom.y);

// Construct parameters
var itemID = '';
var field_sps_no = $feature.asset_no; // Assuming 'asset_no' holds the value for 'sps_no'
var center = coords.y + "," + coords.x;

// Construct the final URL
var finalUrl = urlsource + 'center=' + center + '&field:sps_no=' + field_sps_no + '&itemID=' + itemID;

return finalUrl;
0 Kudos