Select to view content in your preferred language

Hyperlinks from Related Table List in Map Viewer Expression Builder

459
0
12-27-2022 09:03 AM
Labels (3)
Blevins_Mark
Frequent Contributor

I'll apologize in advance as my coding skills are limited at best...

Enterprise Portal (10.9) Map Viewer (Classic)

I have a hosted feature layer with a related table. I am populating the popup for the hosted feature layer with an attribute expression that is pulling information from the related record. One of those attributes is a website url.  The expression to do that is below. My question is how can I have the website url read as a clickable hyperlink in the popup. Currently it is just unformatted text with no hyperlink. Thanks in advance!

// Access Provider Table as Feature Set
var portal = Portal("https://gis.mtdeq.us/portal")
var ProviderInfo = FeatureSetByPortalItem(portal,
"f7be7a2897b6403ab690eb73489a13f7", 1, ['business_name', 'business_location', 'reg_cert', 'website'])

// Filter related features by using a common attribute
var county = $feature.county
var filterStatement = 'county = @county'

// Related features as a variable
var relatedData = Filter(ProviderInfo, filterStatement)

// Sort related features by oldest to newest
var relatedDataSorted = OrderBy(relatedData, 'business_name ASC')

// Build Popup Loop
var popupString = ''
for (var f in relatedDataSorted){

popupString += (f.business_name) + TextFormatting.NewLine +
(f.business_location) + TextFormatting.NewLine +
"Certification/Registration: " + (f.reg_cert) + TextFormatting.NewLine +
(f.website) + TextFormatting.NewLine +
TextFormatting.NewLine
}

return popupString

 

Capture111.JPG

 

 

 

0 Kudos
0 Replies