In sensitive analysis, the ultimate limit is to achieve reliable detection on trace amount of molecules. In this work, Sc- and Ti-decorated graphdiyne were proposed as promising materials for high-efficient molecular detection. Using density functional theory calculations, we investigated the electronic response of single Sc- and Ti-atom-decorated graphdiyne to HCHO (as a typical air pollutant). Thermodynamic analysis predicted that Sc or Ti adatom could be stabilized on the corner sites of single-layer graphdiyne sheet, with migration barriers high enough to prevent Sc or Ti adatom aggregation. The adsorption of HCHO on Sc- or Ti-decorated graphdiyne was found stronger than on pristine graphene or graphdiyne, which provides a prerequisite for molecular sensing. The electronegativity of HCHO leads to strong electronic attraction from Sc or Ti adatom to HCHO, resulting in a remarkable decrease of carrier density in graphdiyne. On Ti-decorated graphdiyne, the electronic attraction of HCHO appears to be stronger than on Sc-decorated graphdiyne and changes the system from metal to n-doped semiconductor. Quantum transport calculations show a decrease of current caused by the adsorbed HCHO. The results systematically exhibit the electronic response of Sc- or Ti-decorated graphdiyne to HCHO and suggest them as promising materials for molecule detection.