Limiting outFields on Attribute Table Related Query

05-26-2016 08:22 AM
Occasional Contributor III

We're attempting to limit the number of fields that are returned by a relationship query and are being displayed in the Attribute Table.

I've looked in _RelationshipTable.js, specifically lines 197-201 and have modified these but the entire schema still is coming through.

var relatedQuery = new RelationshipQuery();

          relatedQuery.objectIds = selectedIds;

          relatedQuery.outFields = ofs.length ? ofs : ["FIELD1", "FIELD2"];

          relatedQuery.relationshipId =;

          relatedQuery.returnGeometry = false;

In addition, I receive an error in the console when I click on 'show related records' in a popup and fire the query (see attached).

I appreciate any help.

0 Kudos
1 Reply
MVP Esteemed Contributor


  I see that error all the time from the AT widget (some I would not be concerned with it).

The ofs.length is normally going to be defined so you will not make it to your ["FIELD1", "FIELD2"] portion of code.

I would look at something more like:

if( === "x"){

    relatedQuery.outFields = ["FIELD1", "FIELD2"];


   relatedQuery.outFields = ofs.length ? ofs : ["*"];