I came across an unusual scenario where setEntityTypes method was working in a regular web interface but that method was not honoring the list of entities specified in a Unified Client interface instead showing all the list of entities.
To debug it I removed the method call for setEntityTypes and tried to use the entity from the “Change view” option. That’s when I realized that the entity wasn’t even showing up in the Unified interface because it was not included in the App.
After adding the entity in the App and adding the setEntityTypes method back it started honoring the entity types I was specifying.
So, whenever setEntityTypes doesn’t seems to be working in unified interface make sure to check if the entity is included in the “App”.