// Attribute expression within Configure Pop-ups for Source Feature - name open_survey
// Auto-populate Survey123 with data below to add new Visit to existing SF
var inspectionSurveyID = "5b1ab06fa33f44a994bdbeb2e7afdcc1";

//Follow this syntax to modify. "&field:SURVEYFIELDNAME=" + $feature.{PROPERTIESFIELDNAME}

var autofillFields = 
"&field:est_id=" + $feature.ELEMENT_SUBNATIONAL_ID 
+ "&field:EO_ID=" + $feature.EO_ID 
+ "&field:track_status=" + $feature.EO_TRACK_STATUS_DESC
+ "&field:element_type="+ $feature.NAME_TYPE_CD
+ "&field:srank=" + $feature.S_RANK
+ "&field:scientific_name=" + $feature.SNAME
+ "&field:common_name=" + $feature.SCOMNAME
+ "&field:SOURCE_FEATURE_ID="+ $feature.SOURCE_FEATURE_ID 
+ "&field:descriptor="+ $feature.SOURCE_FEATURE_DESCRIPTOR
+ "&field:loc_use="+ $feature.LOCATION_USE_CLASS_DESC 
;

//DO NOT EDIT BELOW THIS LINE**********************************
var survey123URL = "arcgis-survey123://?itemID=";

return survey123URL + inspectionSurveyID + autofillFields

*********************************************************************************************************************************

// Attribute expression within Configure Pop-ups for EOs - name open_survey
// Auto-populate Survey123 with data below to add new SF to existing EO
var inspectionSurveyID = "5b1ab06fa33f44a994bdbeb2e7afdcc1";

//Follow this syntax to modify. "&field:SURVEYFIELDNAME=" + $feature.{PROPERTIESFIELDNAME}

var autofillFields = 
"&field:est_id=" + $feature.ELEMENT_SUBNATIONAL_ID 
+ "&field:EO_ID=" + $feature.EO_ID 
+ "&field:track_status=" + $feature.EO_TRACK_STATUS_DESC
+ "&field:element_type="+ $feature.NAME_TYPE_CD
+ "&field:srank=" + $feature.S_RANK
+ "&field:scientific_name=" + $feature.SNAME
+ "&field:common_name=" + $feature.SCOMNAME
;

//DO NOT EDIT BELOW THIS LINE**********************************
var survey123URL = "arcgis-survey123://?itemID=";

return survey123URL + inspectionSurveyID + autofillFields


********************************************************************************************************************************

// View Observation - name view_observation
// Replace the inspectionSurveyID with the survey Form ID
var inspectionSurveyID = "5b1ab06fa33f44a994bdbeb2e7afdcc1";
var autofillFields = $feature.parentglobalid;
var survey123URL = "https://survey123.arcgis.com/share/";
var surveyMode = "?mode=view&hide=navbar,footer&version=latest&globalId="
return survey123URL + inspectionSurveyID + surveyMode + autofillFields