Hello:
I want to relate a table hosted on a private ArcGIS Server to a feature layer hosted on the same server using a field called "OIDStr" in the table and a field caled "OIDstr" in the feature layer. I then want to show a hyperlink field in that related table in the popup I configured for the feature layer. What I have so far which I found at this link is not working. Are there any suggestions that could help me? I also may need to incorporate an if statement found here to prevent getting errors when there is no related data.
var planrecs = FeatureSetByName($map,"House_Number_Change - Address Form and Plan Recs");
var FullAddress = $feature.FullAddress
var filterStatement = 'OIDStr = @OIDstr'
// Related features as a variable
var relatedData = Filter(planrecs, filterStatement)
// Build the pop-up string by iterating through all related features
var popupString = ''
for (var f in relatedData){
popupString += Text(f.AIN, 'no data') + TextFormatting.NewLine +
"Path: " +
DefaultValue(f.Path, 'no data') + TextFormatting.NewLine
}
DefaultValue(popupString, 'No other records to show')