I've put the following Arcade in an Arcade pop-up element for this layer. In the configuration view of the popup the type and address fields return properly but when I click out of the configuration view the type and address views stop returning.
Is there a different way I should be specifying these fields? It seems like there should be a better way than defining all the fields I want to use as variables.


var furl = IIf((!IsEmpty($feature.Website) && Left(Lower($feature.Website), 4)=='http'), $feature.Website, Concatenate(['https://', $feature.Website])) Console('original url ', $feature.Website)
Console('furl ',furl)
var website = IIf(IsEmpty($feature.Website), "", `<br><a href="${furl}"><strong>Website Link</strong></a>`)
var grades = IIf((IsEmpty($feature.Grade_Lowest_NS12) || IsEmpty($feature.Grade_Highest_NS12) || $feature.Grade_Lowest_NS12==-99 || $feature.Grade_Highest_NS12==-99),
"", `<br><strong>Grades:</strong> {Grade_Lowest_NS12} - {Grade_Highest_NS12} `)
return {
type : 'text',
text : `<p>
<strong>Type:</strong> {Type}${grades}${website}
</p>
<p>
<strong>Address:</strong>
<br>
{Site_Address_Line1} {Site_Address_Line2}
<br>
{Site_City}, {Site_State} {Site_Zipcode}
</p>`
}