Solvent-mediated crystal-to-crystal interconversion between discrete lanthanide complexes and one-dimensional coordination polymers and selective sensing for small molecules.