In this nationwide population-based cohort study, we found that SGLT2 inhibitors were associated with a lower risk of the composite outcome of hospitalization for HF or mortality compared to DPP4 inhibitors in patients with both type 2 diabetes and AF. The gene discussed is DPP4; the disease is type 2 diabetes mellitus.