In Map Viewer, I had created an expression to return a list of fields. I check whether the field has the expected prefix ('MAX') and whether its value is equal to 1. I push the field alias into an array and return the return concatenated array.
var theSchema = Schema($feature);
var fields = theSchema['fields'];
var species = [];
for (var i in fields) {
if (Find('MAX', fields[i]['name']) > -1 && $feature[fields[i]['name']] == 1) {
Push(species,fields[i]['alias']);
}
}
return Concatenate(species,', ');
In the Expression editor, this runs properly and returns the expected result.

I use this expression in the Text content
There are {Sum} corals species predicted or confirmed in the {ECOREGION} ecoregion in the {PROVINCE} province: {expression/expr0}
However, this expression does not display in the Map Viewer popup.

Curiously, it does show up in Map Viewer Classic

Why doesn't it show in Map Viewer?