Given a finite, connected 2-complex X such that b2(X)⩽1 we establish two existence results for representations of the fundamental group of X into compact connected Lie groups G, with prescribed values on certain loops. If b2(X)=1 we assume G=SO(3) and that the cup product on H1(X;Q) is non-zero.