I have written an Arcade expression, it has 3 variables named link1, link2, and link3. When I test it in Map Viewer Classic, it says that these variables are assigned but never used. Can someone assist me in helping determine what is wrong with the syntax of my code? (I also tried the same expression except using Decode with same results, says variable assigned but never used)
var link1 = 'https://rtlt.preptoolkit.fema.gov/Public/Resource/ViewFile/9-508-1192?type=Pdf&s=Name&p=7'
var link2 = 'https://rtlt.preptoolkit.fema.gov/Public/Resource/ViewFile/9-508-1192?type=Pdf&s=Name&p=7'
var link3 = 'https://rtlt.preptoolkit.fema.gov/Public/Resource/ViewFile/9-508-1192?type=Pdf&s=Name&p=7'
if ($feature.RESOURCETYPE == "Type II (500 - 1,999 persons)")
return link1 = 'Type II';
if ($feature.RESOURCETYPE == "Type III (250 - 499 persons)")
return link2 = 'Type III';
If ($feature.RESOURCETYPE == "Type IV (249 or fewer persons)")
return link3 = 'Type IV';
![variable is assigned but never used.png variable is assigned but never used.png](https://community.esri.com/t5/image/serverpage/image-id/60336iB51DA16948EBF7B2/image-size/large?v=v2&px=999)
var link = 'https://rtlt.preptoolkit.fema.gov/Public/Resource/ViewFile/9-508-1192?type=Pdf&s=Name&p=7'
var t = Decode($feature.RESOURCETYPE,
'Type II (500 - 1,999 persons)', 'Type II (500 - 1,999 persons)',
'Type III (250 - 499 persons)', 'Type III (250 - 499 persons)',
'Type IV (249 or fewer persons)', 'Type IV (249 or fewer persons)',
'')
If ($feature.RESOURCETYPE != "TBD - Leave Blank"){
return link = t
}