AnsweredAssumed Answered

Records wont show in related feature table - Javascript API

Question asked by athompson_otp on Oct 25, 2017

Hello all!


I am trying to make a webapp that simply has a table (no map) of records drawn from a feature service, and can show related records as well. I found this handy example in the documentation. I can get it to display my feature service records correctly, but I am unable to get the related records to show. After clicking on the option to show related records, a table appears with the correct schema, but that is all. No rows show. I posted the code below but took out the feature service URLs. Anybody see anything blatantly obvious that won't allow me to see my related records?


<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OTP Facility Equipment</title>
<link rel="stylesheet" href="">
<link rel="stylesheet" href="">
<script src=""></script>
margin: 0;
padding: 0;

var equipment;
function chooseEquipmentType(choice){
equipment = choice;
console.log("Equipment Variable is now: " + equipment)
console.log('Service URL is : ' + " MY FEATURE SERVICE URL")
//Allows the page to dynamically change when a new button is clicked
var map;
], function (
FeatureLayer, FeatureTable,
dom, parser, ready
) {
// Create the feature layer
var myFeatureLayer = new FeatureLayer("MY FEATURE SERVICE URL", {
mode: FeatureLayer.MODE_ONDEMAND,
outFields: ["*"],
visible: true,
id: "fLayer"
myTable = new FeatureTable({
featureLayer : myFeatureLayer,
showGridMenu: true,
showAttachments: true,
showRelatedRecords: true,
hiddenFields: ['Facility_ID', 'In_Service','GlobalID', 'Parent_GUID', 'Line_Name', 'Line_Name2', 'Line_Group', 'Line_kV', 'OBJECTID', 'GUID_Calculate', 'created_user', 'created_date', 'last_edited_user', 'last_edited_date'] // field that end-user can show, but is hidden on startup
}, "myTableNode");

// listen to row-click event
// to hide visible popups
myFeatureTable.on("row-select", function(evt){
if (map.infoWindow.isShowing){
// listen to show-attachments event
myFeatureTable.on("show-attachments", function(evt){
console.log("show-attachments event - ", evt);
// listen to show-related-records event
myFeatureTable.on("show-related-records", function(evt){
console.log("show-related-records event - ", evt);

<body class="claro esri">
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'headline', gutters: false" style="width:100%; height:100%;">
<div id="top" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top'">
<p>Click on a type of equipment in the dropdown to see all records currently inventoried in GIS.</p>
<p >
<select name="equipmentType" onchange="chooseEquipmentType(this.value)">
<option value="">Please select an equipment type</option>
<option value="Battery_Bank">Battery Bank</option>
<option value="Breaker">Breaker</option>
<option value="Capacitor_Bank">Capacitor Bank</option>
<option value="Circuit_Switcher">Circuit Switcher</option>
<option value="Motor_Operator">Motor Operator</option>
<option value="Recloser">Recloser</option>
<option value="Regulator">Regulator</option>
<option value="Facility_Transformer">Facility Transformer</option>
<div id="bot" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center'">
<div id="myTableNode"></div>



Any help would be greatly appreciated.