Integration with Esri ArcGIS Survey123:

Integrating with Survey123 is the preferred method, as the URL parameters can insert new records into both spatial and non-spatial related tables, plus the URL encoding is a little bit simpler when compared to Field Maps. To integrate D-Calc with Survey123, configure a popup in the webmap that contains a hyperlink (URL) to the D-Calc app and passes parameters (feature attributes) from the webmap into D-Calc. The URL will also contain a "Return URL" that specifies the app that D-Calc will push data into, as well as the D-Calc parameters to be pushed.

The following Arcade expression builds a URL which:

  1. Sends the pole's GlobalID, circumference, pole number, species, class, and height into D-Calc as a new pole record in the project called "New_Project"
  2. After modeling the pole in D-Calc and clicking the "Send Data" button...
  3. ...the "returnURL" will be executed...
  4. which opens the Survey123 mobile app,
  5. ...and opens the specified survey form ID,
  6. And passes in the remaining section modulus transverse (x) and inline (y) parameters from D-Calc, as well as the pole number and the pole GlobalID (which relates the Survey123 record to the original pole record)
  7. Note that URL encoding is necessary, but this can easily be done with the Arcade URLEncode() function
var S123urlsource = 'https://dcalc.edmlink.com/createPole?poleId='+$feature.globalid+'&DistGL=0&Circumference='+$feature.Circumference+'&poleName='+$feature.PoleID+'&Species='+$feature.Species+'&Class='+$Feature.Class+'&Length='+$feature.Height+'&projectName=New_Project&returnUrl='; 
var FMurlsource='arcgis-survey123://?'; 
var FMparams='itemID=dcc8df93cc2b46b1b0c5a4d08434aeba'; 
var FMGID=Mid($feature.globalid,1,36);
URLEncode('&field:PoleNum=${poleName}}&field:PoleGUID=${poleId}&field:msx1_act=${msx1_act}&field:msy1_act=${msy1_act}');
return Concatenate(S123urlsource,FMurlsource,FMparams,FMAtt);

Integration with Esri ArcGIS Field Maps

D-Calc can also integrate with Field Maps, but the functionality is a bit more limited, since (as of date of this writing), Field Maps does not allow insert or editing of related non-spatial tables via URL parameters. That said, if the workflow is to write D-Calc results back into the spatial "pole" layer, then it is a good fit. (ie, returned D-Calc info is "flat" with the spatial pole (inspection) layer, rather than inserted into a new, non-spatial related table). Field Maps is also appealing for simplicity (no need to deploy Survey123 if you don't really need it).

The following Arcade expression may be deployed in the Esri webmap to construct a URL, which can be added to the layers popup as a hyperlink:

var S123urlsource = 'https://dcalc.edmlink.com/createPole?poleId='+Mid($feature.globalid,1,36)+'&DistGL=0&Circumference='+$feature.Circumference+'&poleName='+$feature.PoleID+'&Species='+$feature.Species+'&Class='+$Feature.Class+'&Length='+$feature.Height+'&projectName=New_Project&returnUrl='; 
var FMurlsource='https://fieldmaps.arcgis.app?'; 
var FMparams='itemID%3D60b6642c6597493eba3200631ae2e8b3%26referenceContext%3DupdateFeature%26featureSourceURL%3Dhttps://services1.arcgis.com/dscgdziA6jUxpQJw/arcgis/rest/services/DCalc_Schema/FeatureServer/0%26'; 
var FMGID=Mid($feature.globalid,1,36); 
var FMAtt=URLEncode('&featureAttributes={"Net_RMS":"')+'${rsm1_net_act}'+URLEncode('","DCalc_Defect1":"')+'${l1_d1_type}'+URLEncode('","DCalc_Defect2":"')+'${l1_d2_type}'+URLEncode('","DCalc_Defect3":"')+ '${l1_d3_type}'+URLEncode('","DCalc_Defect4":"')+ '${l1_d4_type}'+URLEncode('"}'); 
return Concatenate(S123urlsource,UrlEncode(FMurlsource),FMparams,'featureID%3D',FMGID,FMAtt);