Configuring Popups on Activity Feature Layers
Popups in the Activities feature layer can be configured to show activities and related asset information. The related assets can be linked with a Field Maps link. This link can be configured to pass the search value to pull up a particular asset.
You can configure popups in a webmap in any of the following ways:
On MapViewer for ArcGIS Online
On MapViewer Classic for Portal for ArcGIS
For more information, refer to: https://enterprise.arcgis.com/en/portal/10.9.1/use/configure-pop-ups.htm
Note: The portal for ArcGIS Enterprise 10.9.1 MapViewer does not support many of the Arcade expressions options. It is recommended to configure popups using MapViewer Classic in such scenarios. Popup Contents can be set as “A custom attribute display”. Arcade expressions can be defined as Attribute expressions.
You can configure popup to show any field information.
<p>
Activity Description : {ACTIVITY_ID} , {ACTIVITY_DESC} , {REQUIRED_BY_DATE}&nbsp;
</p>
<p>
Asset Description :{LOCATION_INFO}&nbsp;
</p>
<p>
Assigned Crew Name: {CREW_NAME}&nbsp;
</p>
<p>
Related Assets : {expression/expr0}//This corresponds to the Arcade expression
</p>
Adding Field Information
If desired, field information can be shown on the popup as well.
In MapViewer, the fields list can be shown by adding the Fields list as another content in the popup.
In MapViewer classic, when Popup contents is set to custom attributes display, fields can be added as expression in the popup editor.
Arcade Expressions
Activities popup can be configured with Arcade expression to display and link the related Activity Assets with a Field Map search link providing the search value from the ActivityAssets related table. If a search value is not found, the asset description will not be linked.
A sample arcade expression to achieve this is shown below.
var relatedRecords = FeatureSetByRelationshipName($feature, "SDE.ActivityAssets")
var relatedInfo ="";
var infoString = "";
var recInfoString=""
var searchVal="";
var featureURL= "https://fieldmaps.arcgis.app?referenceContext=search&itemID=<enter webmap Id>&search="
for(var rec in relatedRecords)
{
relatedInfo = rec.ASSET_DESC;
searchVal = rec.SEARCH_VALUE;
recInfoString ="";
if(searchVal != null)
{
recInfoString = "<li><a href='"+featureURL+searchVal+"'>"+relatedInfo+"</a></li></br>";
}
else {
recInfoString = "<li>"+relatedInfo+"</li></br>";
}
infoString = infoString+recInfoString;
}
 
return {
type : 'text',
text : `<ul>${infoString}</ul>` //this property supports html tags
}
 
Note: MapViewer Classic in Enterprise version 10.9.1 does not support the return of dictionary object. So, infoString variable should be returned as a String. Example: return infoString;