Display local database data in popup

832
2
Jump to solution
03-10-2017 12:26 AM
OliverTylšar
New Contributor II

Hello. Do you have any idea how to display data from local database in the popup? I'm using some FeatureLayer and PopupTemplate from ArcGIS examples and that displays only data stored on arcgis server. I figured out how to get the ObjectID from the 'clicked' area. So now when I sync this ID with some ID on my database, I'd like to show some additional info in the popup. Ajax might work for this, but I'm not sure how to use it within dojo. So the whole process should be like this:

Click the area of FeatureLayer -> get the OBJECTID, for example 450 -> search for an object (row) in Class (table) where its ID equals 450 and return some data stored in the local database -> show these data in the popup.

Even though it's not a common task as I can see, I think it would be very useful as you don't have to be directly limited with that only data from geo table on ArcGIS server. I'm just looking for some fresh ideas from more esri-friendly developers, how to get this feature work. Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
OliverTylšar
New Contributor II

I finally solved it by myself using dojo/request. Nice and easy to work with it, almost as much as with jQuery. Thanks anyway.

View solution in original post

0 Kudos
2 Replies
PanagiotisPapadopoulos
Esri Regular Contributor

Try to add this local table on the mxd and relate on ArcMap level this table with the feature class.

Then publish as service this map. on the rest end point you will see that exist a relationship between feature class and table.

From javascript api you can use the following example in order to retrive data from the related table

Popup with related fields | ArcGIS API for JavaScript 3.20 

0 Kudos
OliverTylšar
New Contributor II

I finally solved it by myself using dojo/request. Nice and easy to work with it, almost as much as with jQuery. Thanks anyway.

0 Kudos