Hi Esri Community!
I'm working with a map in ArcGIS Online where I have a feature layer and a related table. I'm trying to create an Arcade expression to display links from a field called "Media Address" in the related table within the popup.
I've tried the following Arcade expression, but didn't work as expected:
I'm getting the link addresses from the field "MediaAdresses" from the related table as text and not as "Links" 😞
So I'm looking for assistance in refining this expression or suggestions so I can get the actual link from this field from the related table.
Any insights or alternative solutions would be greatly appreciated! Thank you
If you want a working link, you have to use an Arcade element. Here's one example of creating a popup with links from a related table
var related = FeatureSetByRelationshipName($feature, "DCGIS.SURDOCS");
var relatedCount = count(related);
var output;
if (relatedCount == 0) {
output = `<p>There are no surveys for this property.<\p>`;
} else if (relatedCount == 1) {
var rec = First(related);
output = `There is 1 survey for this property:
<br>  • <a href="${rec.FILENETLINK}">${rec.DOCGUID}</a>`;
} else {
output = `There are ${relatedCount} surveys for this property:`;
for (var rec in related) {
output += `<br>  • <a href="${rec.FILENETLINK}">${rec.DOCGUID}</a>`;
}
}
return {
type : 'text',
text : output
}
Hi @KenBuja : How can I see your example in actions? Can I use this in a Map Viewer Classic embedded map that has the popup on the side panel? I happen to be using the same source services as you are showing. Thanks!
Try returning popupString in an object?