Hello - I would like to create a dynamic pop-up that links out to an As-Built document related to a feature. However, some features do not have any As-Builts and have empty values in the data. If that is the case, I want the pop-up to read: There is no As-Built Plan for this project.
What I have so far is an attribute expression:
Solved! Go to Solution.
I just revisted and think I got it to work, instead of an expression and a text popup, just add an Arcade item and do all of it there:
add this code:
var nolink = "There is no As-Built Plan for this project."
var url1 = $feature.Orignal_Project_PDF
var base = ""
if (IsEmpty($feature.Orignal_Project_PDF)) {
var base = nolink;
} else {
var base = '<a href='+url1+' target="_blank">Link</a>';
}
return {
type : 'text',
text : "<p><strong>As-Built Plans:</strong><br>"+base+"</p>"
}
This gets you closer, however it formats the static text as a link as well...
The expression:
Then to add that in the popup add text and insert your expression as a link and put in your expression name.
HTML:
<p>
<strong>As-Built Plans:</strong><br>
<a href="{expression/expr0}">{expression/expr0}</a>
</p>
Reference: Solved: Re: Arcade add URL to pop-up - Esri Community
I just revisted and think I got it to work, instead of an expression and a text popup, just add an Arcade item and do all of it there:
add this code:
var nolink = "There is no As-Built Plan for this project."
var url1 = $feature.Orignal_Project_PDF
var base = ""
if (IsEmpty($feature.Orignal_Project_PDF)) {
var base = nolink;
} else {
var base = '<a href='+url1+' target="_blank">Link</a>';
}
return {
type : 'text',
text : "<p><strong>As-Built Plans:</strong><br>"+base+"</p>"
}
@Neal_t_k this worked, thanks!