Pop-ups and URL Fields with Blank Values in AGO

2645
4
07-18-2016 06:31 AM
CalixMartinez1
New Contributor

I have a feature service in AGO with a URL field in which some of the features have a blank value (no URL). The problem I'm having is that the pop-up populates a hyperlink whether there is a value in the field or not. If someone attempts to go to one of the "blank" hyperlinks, it causes the page to refresh and the end-user is sitting there thinking something went wrong.

I'd like to have the response of clicking a blank hyperlink be more clear to the user. Ideally I'd like it to either not populate a hyperlink if the field is blank, or send the user to another URL with a generic "this content does not exist" page.

I'm trying to avoid populating the blank URL fields because we have some applications that may run into problems if the attributes changed.

I'm trying to find a solution I can implement through the pop-up. Any feedback would be great. Thank you.

0 Kudos
4 Replies
AdrianWelsh
MVP Honored Contributor

Calix,

This is an interesting dilemma. Is this an out-of-the-box web application in ArcGIS Online​ or is it something custom made (through JavaScript, etc.)?

0 Kudos
CalixMartinez1
New Contributor

They're custom applications.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

What flavor are you using to develop the app?  ArcGIS API for JavaScript​ or the Web AppBuilder for ArcGIS​ using Web AppBuilder Custom Widgets​ ?  If any of the above, you may want to move your post to one of those "places" (although I already tagged them) vs. the more generic Web Developers. 

Also tagging Robert Scheitlin, GISP 

Although I don't have a solution, my guess would be to check to see if the field is blank, then send them to a "sorry, not data....close/return" popup or web page.  You probably already thought of that, but just in case...

RobertScheitlin__GISP
MVP Emeritus

Calix,

  If you app is built using the JS API then you can use the popups setContent function to build your popup instead of letting the API do it automatically and thus you will be able to have logic to check for the null field.