Esri examples
Both Survey123 and Field Maps can open D-Calc from a pole feature and take the results back.
| App | Results go to | Notes |
|---|---|---|
| Survey123 | A new or existing survey, with the results in its fields | Preferred: a survey can write to related tables, such as an inspection table |
| Field Maps | The pole feature's own attributes | Updates the feature directly. Field Maps can't update related tables from a link. |
In both, you build the launch link with an Arcade expression (for example in a pop-up's link, or a calculated field) from the feature's attributes. Replace the field names below with yours.
Survey123
The return URL is a Survey123 link that opens your form with fields prefilled from D-Calc's results:
arcgis-survey123://?itemID=<your form's item ID>&field:PoleNum=${poleName}&field:PoleGUID=${poleId}&field:NetRSM=${rsm1_net_act}&field:Defect1=${l1_d1_type}
An Arcade expression for a pop-up link:
// The return URL: placeholders stay as ${…} for D-Calc to fill in
var returnUrl =
'arcgis-survey123://?itemID=<your form item ID>' +
'&field:PoleNum=${poleName}' +
'&field:PoleGUID=${poleId}' +
'&field:NetRSM=${rsm1_net_act}' +
'&field:Defect1=${l1_d1_type}';
var params = {
poleId: $feature.GlobalID,
poleName: $feature.PoleID,
Circumference: $feature.Circumference,
DistGL: 0,
Species: $feature.Species,
Class: $feature.Class,
Length: $feature.Height,
returnUrl: returnUrl,
};
return 'dcalc://createPole?' + UrlEncode(params);
UrlEncode() with a dictionary encodes each value, including the whole return URL.
If Survey123 isn't installed, D-Calc says it couldn't send results: no app on the device can open the link.
Field Maps
The return URL is a Field Maps link that updates the feature. Its featureAttributes is a JSON object of the fields
to set:
https://fieldmaps.arcgis.app?itemID=<map item ID>&referenceContext=updateFeature&featureSourceURL=<feature layer URL>&featureID=<the feature's GlobalID>&featureAttributes={"Net_RMS":"${rsm1_net_act}","DCalc_Defect1":"${l1_d1_type}"}
The return URL's own featureAttributes value must be encoded, but the ${…} placeholders inside it must stay as
they are so D-Calc can find them. Encode the text around each placeholder, and leave the placeholders out of it:
var encodedAttributes =
UrlEncode('{"Net_RMS":"') + '${rsm1_net_act}' + UrlEncode('","DCalc_Defect1":"') + '${l1_d1_type}' + UrlEncode('"}');
var returnUrl =
'https://fieldmaps.arcgis.app?itemID=<map item ID>' +
'&referenceContext=updateFeature' +
'&featureSourceURL=' +
UrlEncode('<feature layer URL>') +
'&featureID=' +
$feature.GlobalID +
'&featureAttributes=' +
encodedAttributes;
var params = {
poleId: $feature.GlobalID,
poleName: $feature.PoleID,
Circumference: $feature.Circumference,
DistGL: 0,
returnUrl: returnUrl,
};
return 'dcalc://createPole?' + UrlEncode(params);
:::tip Test with the QA app
Point a copy of the expression at dcalc-qa:// to try an integration with the TestFlight build before changing the
production one.
:::
Reopening a pole
Pass the same poleId (such as the feature's GlobalID) every time. D-Calc then reopens the inspector's pole rather
than making a new one, and keeps their damage entries. See
When the pole is already on the device.
To reopen a pole with everything D-Calc returned last time, store the output parameters you
need (dia1, l1_d1_type, l1_d1_param1 and so on) and send them back in the next launch link.