get id from global query