method to get selected table from top-level