AnsweredAssumed Answered

Getting a popup to work with related tables

Question asked by cynthiak on Dec 20, 2017
Latest reply on Dec 20, 2017 by cynthiak

This is my first attempt at a Javascript app, so I am very new at this.  We are trying to upgrade an old MapObjects site that sees a lot of traffic.  Mainly, people click on a parcel and it shows them all the information about that parcel.  There are several tables that are linked to the parcel layer.  I have tried creating a Map Service (hosted on our server) that has the parcel layer with a relationship class to the tables, and I have also tried creating a feature layer (hosted on AGOL) that is created from the parcels with those same relationship classes.  Neither of these have worked.  I may not have set these up correctly either.  If I point the url to a parcel layer with no related tables, it works.  As soon as I change that url to the map service or the feature layer with related tables, nothing shows in the popup.  What is the best way to go about getting a popup with related tables?  Any help is appreciated.

 

var parcels = new FeatureLayer({
          url: "https://services3.arcgis.com/XXXXXXXXXXXXXX/arcgis/rest/services/Parcels/FeatureServer",
          id: "taxlots",
          outFields: ["*"],
          popupTemplate: { // autocasts as new PopupTemplate()
           title: "Parcel Number: ",
           content: [{
               type: "fields",
               fieldInfos: [{
              fieldName: "ASSESSOR_N",
              visible: true,
              label: "Assessor Number"
            }, {
              fieldName: "relationships/0/FIRST_NAME",
              visible: true,
              label: "First Name"
            }, {
              fieldName: "relationships/0/LAST_NAME",
              visible: true,
              label: "Last Name"
            }]
           }]
           },
     });

Outcomes