Datasource selection function