I'm working on an Arcade content block expression for a popup that will be viewed in Field Maps. The goals are to show a link to a CW inspection or work order that needs to be completed (if applicable), and to display a table summarizing previous work on that asset. It works great in the map viewer, but does not work in Field Maps. Interestingly, the link fails completely, but the table will draw only the header row. I've split those two functions into different content blocks so I'm only dealing with one issue at a time. I've included screenshots and code snippets below. Anyone have an idea how to get that to work? I know I can get the hyperlink to work if I just pass it as a hyperlink in a text block, but that removes the "only show it if applicable" logic. The table is what really mystifies me, as the header displays just fine.
For reference, I'm on Enterprise 11.1 and Field Maps 24.2.1


Here is my code for the link:
//get open hydrant inspections
var currentInspections = FeatureSetByName($map, "Open Hydrant Dry Checks",['InspectionId']);
//find the inspection that matches this hydratn
var cwID = $feature.CW_ID;
var query = `FeatureUid = '${cwID}'`;
var inspNow = Filter(currentInspections,query);
//base url
var baseURL = "cityworks11://openWorkActivity?workActivityType=2&workActivityId=";
//if there is an inspection, create link
If(Count(inspNow)>0){
var inspectionID = First(inspNow)["InspectionId"];
var inspURL = baseURL + inspectionID;
var linkText = `<a href="${inspURL}" >Complete Dry Check Inspection In Cityworks Mobile</a>`;
}
//if not, return a blank line
else{
var linkText = ``;
}
return {
type : 'text',
text : linkText //this property supports html tags
}
And here is the code for the table:
//get previous inspections and find those that are for this hydrant
var prevInspections = FeatureSetByName($map, "Previous Hydrant Inspections",['InspectionId','InspTemplateName','InspDate','ObservationSum','FeatureUid']);
var cwID = $feature.CW_ID;
var query = `FeatureUid = '${cwID}'`;
var relInspections = OrderBy(Filter(prevInspections,query), 'InspDate DESC');
//start HTML text with table header
var baseText = `<table>
<tr>
<th align = "left" width = "100">Date</th>
<th align = "left" width = "120">Inspection Type</th>
<th>Summary</th>
</tr>
`
//build table with alternating color rows
count = 1;
for(var i in relInspections){
var inspDate = `${Month(i.InspDate)}/${Day(i.InspDate)}/${Year(i.InspDate)}`;
var inspType = Decode(i.InspTemplateName,"Hydrant Dry Check Inspection",'Dry Check',"Hydrant Wet Check Inspection","Wet Check","Other");
var color = IIf(count%2==0 , '#ffffff', '#e6e6e6');
count += 1;
var newRow = `<tr style = "background-color:${color}">
<td>${inspDate}</td>
<td>${inspType}</td>
<td>${i.ObservationSum}</td>
</tr>`;
baseText += newRow;
}
//finish HTML text
baseText += `</table>`;
return {
type : 'text',
text : baseText
}