We presented the immobilization of ionic liquids on the channel walls of COFs using a post-synthetic strategy. The ionic [Et4NBr]50%-Py-COF afforded a high CO2 adsorption capacity of 164.6 mg g(-1) (1 bar, 273 K) and was developed as an effective heterogeneous catalyst for the transformation of CO2 into value-added formamides under ambient conditions.