Select to view content in your preferred language

How to use relationship to populate an infoTemplate/popupTemplate

2739
3
05-18-2015 01:09 PM
TracySchloss
Frequent Contributor

I have a data set with columns  that include codes for provider type and specialty type.  These each have their own corresponding code description table, each containing the code as it appears in the data (10, 20, 30) , and then a column containing the description (hospital, clinic, ambulance). 

How do I set my infoTemplate up to use the description instead of the code in this scenario?  I set the service up to have a relate between the code columns and the description tables, but I'm having a hard time with the syntax.  I thought I could use a relationship to pull this information, but then I'm also reading about a relationshipQuery. 

I have little or no control over the content of any of these tables.   I typically use a featureLayer with an infoTemplate.  I've looked into popupTemplates as well, but that seems to have an extra level of complexity I don't need.  Unless I must use a popupTemplate instead to use the syntax to get to the related table?

Here is the service:

https://ogitest.oa.mo.gov/arcgis/rest/services/DSS/medProvider/MapServer/0

0 Kudos
3 Replies
thejuskambi
Regular Contributor

Please clarify if my understanding is correct. You have a FeatureLayer which has 2 columns which are codes and 2 other tables which has the description for those codes. and you want to replace the codes with description in the tables.

You could use a Query layer while creating the mapservice and control what is displayed in the map service. Hope this was helpful.

0 Kudos
TracySchloss
Frequent Contributor

I suppose I could join to both these tables and author the service that way, but I was hoping for a solution where I didn't have to create all the joins.  It makes the field names much more complicated to deal with, and is a performance hit as well.  

0 Kudos
thejuskambi
Regular Contributor

We are using Query layer in one of our projects and it works pretty good. it shouldn't cause much of a issue as it just couple of simple code and description, no complex calculations. If you feel the performance is still bad, you could create a Spatial view instead. As far as column names, you can always control them in the query or use alias names. this is a good solution if you do not want to do any coding in the client side.

0 Kudos