A versatile logic detector and fluorescent film based on Eu-based MOF for swift detection of formaldehyde in solutions and gas phase.