Hyperlinks for different features in same layer AGOL

293
1
11-27-2019 12:25 PM
DanielSedlak
New Contributor

Hello All,

In AGOL,I would like to be able to create hyperlinks from a layer's pop-up. I would like to be able to have different links for different features, but all these features are within the same layer.

My situation - I have a "Subdivision Phase" polygon layer for the whole city, say 100 features in all, with say, 10 different subdivisions. So 10 features for Subdivision 1, 10 features for Subdivision 2, etc...When a user clicks on a pop-up for a feature in Subdivision 1, I would like them to be able to click a link to Subdivision 1's original plans. A Subdivision 2 feature they can click link to Subdivision 2 plans, and so on...

I can easily just make the subdivisions into different layers and tackle it that way, but I foresee myself having to do this type of thing often. Any advice out there?

Thanks in advance, 

-Dan

0 Kudos
1 Reply
AndyShoemaker
Esri Contributor

Hi Dan,

You should be able to take care of this with Arcade expressions. Depending on how the data is set up, the expressions would be of varying complexity

If you have the subdivision information in the data, you can simply run that value in an if/then/else expression:

if (subdivision_number == 1){

     return URL_1

}else if (subdivision_number == 2){

     return URL_2

}else if( subdivision_number == 3){

     return URL_3

}

If the subdivision is stored in another layer (it sounds like this is your set up), you can simply pull it with a intersection. 

var intersecting_division = Intersects ($feature, subdivision_feature)

if (intersecting_division.subdivision_number == 1){

     return URL_1

}else if (intersecting_division.subdivision_number == 2){

     return URL_2

}else if( intersecting_division.subdivision_number == 3){

     return URL_3

}

What ever you return as the URLs you can then just set as a hyperlink in the pop-up. You can also built the URL within the arcade if you need more variants, such as a specific feature's plans or permits. 

Andy

Andy Shoemaker