How do I Step through related records in a Feature Layer?

3154
1
05-05-2015 02:37 PM
ChrisSergent
Regular Contributor III

I believe this will involve the query task.

I have code that will provide me information on street supports:

var supportId, type, address;
        app.supportLayer.on("click", function (evt) {
            supportId = evt.graphic.attributes.SUPPORTID;
            type = evt.graphic.attributes.TYPE;
            address = evt.graphic.attributes.ADDRESS;
            app.attributesModal.modal("show");
            document.getElementById("address").value = address;
            console.log(supportId);
            console.log(type);
            console.log(address);
        });

This feature layer is: http://maps.decaturil.gov/arcgis/rest/services/test/StreetSignTest/FeatureServer/1

It has a unique SUPPORTID.

The layer of sign that I want to get records from is: http://maps.decaturil.gov/arcgis/rest/services/test/StreetSignTest/FeatureServer/0

In this table, the related field is SUPPORTID

An example of what I have is I want to search for the value of SUPPORTID and get all records that match the SUPPORTID in the streetSigns layer. I have four street signs with a supportId of 1903. How would I query those four street signs and then display one at a time based on a key push, so I could see one record at a time?

Tags (2)
1 Reply
ChrisSmith7
Frequent Contributor

Chris,

Regarding the relationship query, have you had a chance to review the Esri demo?

Query related records | ArcGIS API for JavaScript