Catalyzes the glycosylation of flavonoids at the 3-O-position. Glycosylates the 7-O-position if the 3-O-position is not available. Also able to perform 3-O-glycosylation of anthocyanidins. Secondary metabolite biosynthesis; flavonoid biosynthesis. Highly expressed in flower buds, flowers and pods. Lower expression in leaves, petioles and stems. Expressed in developing seeds, with a maximum at 16 days after pollination. Not expressed in nodules. Strongly down-regulated by wounding or by methyl jasmonate. For the flavonols kaempferol and quercetin, a significant activity was also observed with UDP-galactose as sugar donor. The reverse reaction (deglycosylation) is observed, but not with formononetin 7-O-glucoside. Belongs to the UDP-glycosyltransferase family.