Hi all, this issue concerns ArcGIS JS API 4.19. I've been reading over the FeatureTable documentation and was surprised to see there doesn't seem to be a way to only show a subset of features on the table by providing a list of OBJECTIDs. It shows the entire list of features on a layer, which is much more information than users will need.
There is a way to filter by geometry, only showing features that are in the view extent, which makes me wonder if there is some undocumented method or another strategy altogether that might accomplish this task. But so far I'm at a dead end. I'd like to use ArcGIS' table but if there's no way to show a targeted subset, I might need to roll my own. Please let me know if there's a better way.
Solved! Go to Solution.
You may be able to apply a definitionExpression to the featureLayer that is associated with the table for the desired results.
If you don't want to modify the featureLayer that is displayed on the map then try creating an in-memory only featureLayer with the desired definitionExpression to link to the featureTable.
You may be able to apply a definitionExpression to the featureLayer that is associated with the table for the desired results.
If you don't want to modify the featureLayer that is displayed on the map then try creating an in-memory only featureLayer with the desired definitionExpression to link to the featureTable.
Ah I was wondering if something like that would be possible. I'll try it out and see if that works. Thanks for the suggestion!
This worked! I was able to do:
const testlayer = new FeatureLayer({
url: "https://my-feature-url",
definitionExpression: "OBJECTID = 87"
});
Thanks!