Select to view content in your preferred language

JavaScript SDK Bug(?): FeatureLayer.allTables - titles contain Service Name

111
1
2 weeks ago
NiklasKöhn
Esri Contributor

I just realized that the table titles in a FeatureLayer contain the service name as a prefix. This is reproducible in ArcGIS Enterprise 11.3 and currently in ArcGIS Online.

To be clear:
This gives me a list of "<LayerTitles>"...

webmap.allLayers.items.map(t => t.title)


...while this gives me a list of "<ServiceName> - <TableName>"

webmap.allTables.items.map(t => t.title)


Same goes for webmap.tables.

Is this a bug, @JuliePowell?

Here's a little sample to demonstrate the issue (open console): https://codepen.io/esride-Nik/pen/vENKeNj. This is what it looks like:

NiklasKhn_0-1753351315837.png



1 Reply
NiklasKöhn
Esri Contributor

There's a code snippet in the docs at Map.allTables that indicates  that should be different. The following comparison wouldn't work:

// A feature layer where isTable = true.
const foundTable = map.allTables.find(function(table) {
  // Find a table with title "US Counties"
  return table.title === "US Counties";
});

 

0 Kudos