Configuring Pop-up on Activity Feature Layers
Pop-ups 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 pop-ups 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 pop-ups using MapViewer Classic in such scenarios. Pop-up Contents can be set as “A custom attribute display”. Arcade expressions can be defined as Attribute expressions.
You can configure pop-up 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 necessary, the field information can be displayed on the pop-up as well.
In MapViewer, to view the list of fields, add the Fields list as another content in the pop-up.
In MapViewer classic, when Popup contents is set to Custom Attributes Display, fields can be added as expression in the pop-up editor.
Arcade Expressions
Activities pop-up 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;