We present RNA-mechanically induced trapping of molecular interactions (RNA-MITOMI), a microfluidic platform that allows integrated synthesis and functional assays for programmable RNA libraries. The interaction of a comprehensive library of RNA mutants with stem-loop-binding protein precisely defined the RNA structural and sequence features that govern affinity. The functional motif reconstructed in a single experiment on our platform uncovers new binding specificities and enriches interpretation of phylogenetic data.