I have a feature service that identifies where we have soils data / resources. I have a related table that provides details to all of those resources. I am trying to configure the pop-up so that all the details appear when a user clicks on a polygon. The code that I use is included below:
So, looking at this, I believe the issue is that your HTML could be inside of the text quotes.
So a correction to your code would be:
@MarkChappell Thank you for your response.
Unfortunately it does not recognize the HTML tags. It treats it a regular text.
Ohhhh okay. I ran into this issue previously, and ended up choosing the messier solution. Instead of using a single expression, I added multiple content attributes (a variety of switching back and forth from Text to Arcade).
This is what I ended up doing for the solution:
It ended up with the following results.
Not sure if this is the solution that you're looking for, but it is at least, a solution.
In the return you can reference the popupString variable, you dont have to construct your string there. This is handy if you use loops to construct stings.
return {
type: 'text',
text: popupString
};
Cheers
Peter
It took me some doing to understand the requirements, but I've found two different approaches using Arcade elements (as opposed to Text elements):
One is just to build an HTML text string. You can create the formatting using an HTML table, so label is column 1 and value is column 2. A bit of extra work, but does allow you do do things like add <b> tags only where you want
To get a popup with the default formatting, use the fieldInfos method (the fields type). After a lot of trial and error, I think I understand it:
//Fields pulled using the $feature['fieldname'] format but aren't explictly referenced using the $feature.fieldname format may not appear. Including them as the line below appears to solve the problem, even if they don't appear in the popup
$feature.Creator
var flds = ['OBJECTID','Category', 'Creator'];
var info = [];
var atts = {};
for (var i in flds) {
var fldname = flds[i];
Push (info, {'fieldName': fldname})
atts[fldname] = $feature[fldname];
}
return {
type: 'fields',
title: 'My Title',
description : 'My description',
fieldInfos: info,
attributes : atts
}