Two of the 3 links in my popup work fine and go to the website in the var link, until I click on a point that references 'Type IV'. When I click on any point in my webmap that is Type IV, the link goes to my webmap.
I don't see how that expression returns the URL. Is it link += 'Type'? Reading your expression, those conditions would result in link being overwritten.
Also, when you're just mapping a single attribute to different outputs, you could use Decode instead.
var t = Decode($feature.RESOURCETYPE,
'Type II (500 - 1,999 persons)', 'Type II',
'Type III (250 - 499 persons)', 'Type III',
'Type IV (249 or fewer persons)', 'Type IV',
'')
If (!IsEmpty(t)){
return `your-url/${t}`
} else {
return 'no link'
}
Decode works better, thank you. But, 'no link' shows up in my popup as a link to my webmap. Any thoughts on how to ensure it is text and not a Link?
Where exactly is this being used? Is the map public? I can't really tell why it would behave this way without more context.
The map is not public. I modified your code a tad bit: