Compounds of formula (I) and pharmaceutically acceptable salts or radiolabelled forms thereof, wherein R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12 and m are as defined in the specification, are useful in treating conditions or disorders prevented by or ameliorated by the Cystic Fibrosis Transmembrane Conductance Regulator (CFTR) protein. Methods for making the compounds are described. Also described are pharmaceutical compositions of compounds of formula (I), and methods for using such compounds and compositions.