Scan query and add view