Arcade Expressions
1. To invoke the Task layer, the Arcade expression is as below:
var fM = "https://fieldmaps.arcgis.app?"
var refC = "referenceContext=addFeature"
var itemID ="itemID=<enter webmapId>"
//Tasks feature layer url//Tasks feature layer url
var featSource = "featureSourceURL=https://services8.arcgis.com/ /arcgis/rest/services/WorkTasks/FeatureServer/0"
var geometryVar = UrlEncode(Geometry($feature));
//Populate GISID Field through arcade expression, getting the global Id of the asset
var featAttparams = '{"GISID":"' + Mid($feature.GlobalID,1,36)+'"}'
var encodeFeat =UrlEncode(featAttparams)
var urlFormed = Concatenate([fM,refC,"&",ItemID,"&",featSource,"&","featureAttributes=", encodeFeat])
return {
type : 'text',
text : `<a href=${urlFormed}><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-add-edit-page.svg"></a>Create Work Order/Request`
}
2. To create a work request in Oracle Field Service with the global ID of the asset passed from Field maps, the navigation link should be of the following format:
https://<OFS instance>/mobility/#plugin=pickUpWork&contextScreen=activity_list&requestType=GISWR&gisId=<asset global Id>
The Arcade expression to add this link can be:
var WRURL = "https://ofsinstance.fs.ocs.oraclecloud.com/mobility/#plugin=pickUpWork&contextScreen=activity_list&requestType=GISWR&gisId="+Mid($feature.GlobalID,1,36)
return {
type : 'text',
text : `<a href=${WRURL}><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-batch-edit.svg"></a>Create Work Request in OFS`
}
3. To create a work order in Oracle Field Service with the global ID of the asset passed from Field maps, the navigation link should be of the following format:
https://<OFS instance>/mobility/#plugin=pickUpWork&contextScreen=activity_list&requestType=GISWO&gisId=<asset global Id>
The Arcade expression to add this link can be:
var WRURL = "https://ofsinstance.fs.ocs.oraclecloud.com/mobility/#plugin=pickUpWork&contextScreen=activity_list&requestType=GISWO&gisId="+Mid($feature.GlobalID,1,36)
return {
type : 'text',
text : `<a href=${WRURL}><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-batch-edit.svg"></a>Create Work Order in OFS`
}
4. To navigate to Oracle Field Service from Field Maps, add a text link.
<div>
<a target="_blank" rel="noopener noreferrer" href="https://<ofscinstance>.fs.ocs.oraclecloud.com/mobility/"><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-bank-file-return.svg"></a> Go to OFS
</div>
5. To configure in Mapviewer classic for Portal for Enterprise, configure the popup content with Arcade expression links as below:
<div>
<a href="https://<ofscinstance>.etadirect.com/mobility/" rel="nofollow ugc" target="_blank"><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-bank-file-return.svg" /></a> Go to OFS
</div>
<div>
<a href="{expression/expr0}" rel="nofollow ugc"><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-add-edit-page.svg" /></a>Create Work Order/Request in Field Maps
</div>
<div>
<a href="{expression/expr1}" rel="nofollow ugc"><img src="https://static.oracle.com/cdn/fnd/gallery/2404.0.1/images/ico-activities.svg" /></a>Create Work Order in OFS
</div>
<div>
<a href="{expression/expr2}" rel="nofollow ugc"><img src="https://static.oracle.com/cdn/fnd/gallery/2401.0.3/images/ico-batch-edit.svg" /></a>Create Work Request in OFS
</div>