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 to support the createPole function which:
- 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"
- After modeling the pole in D-Calc and clicking the "Send Data" button...
- ...the "returnURL" will be executed...
- which opens the Survey123 mobile app,
- ...and opens the specified survey form ID,
- 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)
- 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);
Expanding upon the previous example, to retrieve a previously created and saved pole within D-Calc, a separate popup within the webmap would be configured to call the viewPole function similar to the createPole example above with the exception of the two required input parameters being poleId and projectName. The returnURL can be identical to return any updates (e.g., damages) modeled in D-Calc to Survey123.
Organizations that leverage the SYNC functionality, which will save pole results to the EDM D-Calc Google Cloud, can access those poles from any user/device using viewPole.
The example Arcade would be as follows:
var S123urlsource = 'https://dcalc.edmlink.com/viewPole?poleId='+$feature.globalid+'&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 for createPole, 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);
The following Arcade expression may be deployed in the Esri webmap to construct a URL for viewPole, which can be added to the layers popup as a hyperlink:
var S123urlsource = 'https://dcalc.edmlink.com/viewPole?poleId='+Mid($feature.globalid,1,36)+'&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);