Hello,
I have a situation where I am trying to use Arcade loops to generate a list of values, and return unique hyperlinks for each value in an Arcade popup element html return. Here is the setup:
I have a parcel dataset with PIDs and a zoning layer, also with PIDs. Some parcels in the zoning layer share a PID in common with the parcel PID because the parcel has multiple zoning designations. An example:

The black outline shows one parcel on the parcel layer, but the zoning layer has two corresponding parcels with the same PID, but different zoning designation. I used the following code to loop through a filter and give me all the different zoning codes for a given PID.
var zoningLayer = FeatureSetById($map, "17937d72f47-layer-18",['PID','ZONING']);
var zdInter = Filter(zoningLayer, 'PID=@parcelPID');
var zd
var zoneList
var zl
var zoneLink
var z
if (IsEmpty(zdInter)!=null){
for (var zoningPIDs in zdInter)
{
// Set links
zl = decode(zoningPIDs.ZONING,"RURAL","<rural link URL>","R1-44","<r1-44 link URL>",'etc')
// Final zoning description
zd = decode(zoningPIDs.ZONING,"RURAL","Rural","R1-44","R1-44: One Family- 44,000 sf. min.","etc")
zoneList += `<p style="font-size:16px;">${zd}</p>`+'\n'
zoneLink += zl
z = `<a href="${zoneLink}" target="_blank"><span style="font-size:16px;">${zoneList}</span></a>`
}
}
Here is the relevant portion of the HTML return:
<div style="background-color:#3f540f;padding:5px;">
<span style="color:#ffffff;font-size:18px;"><strong>District Information</strong></span>
</div>
<table style="width:100%;">
<tbody>
<tr>
<td>
<span style="font-size:16px;"><strong>Zoning District</strong></span>
</td>
<td>
<span style="font-size:16px;">${z}</span>
</td>
</tr>
Okay, so generating the list of zoning districts if there are multiple (the zoneList variable), works just fine. The problem is that the code as written above concatenates the link strings if there are multiple and applies them to the entire zoning district list:

If you click on either Rural or R1..., it takes you to the same link, which is just two of the links from the zl variable shoved together.
My question then: is there a way to essentially "match" the link from the first decode with the text string from the second decode such that there would be multiple different links in the resulting popup?