As many organic molecules, formic acid (HCOOH) has two conformers (trans and cis). The energy barrier to internal conversion from trans to cis is much higher than the thermal energy available in molecular clouds. Thus, only the most stable conformer (trans) is expected to exist in detectable amounts. We report the first interstellar detection of cis-HCOOH. Its presence in ultraviolet (UV) irradiated gas exclusively (the Orion Bar photodissociation region), with a low trans-to-cis abundance ratio of 2.8+-1.0, supports a photoswitching mechanism: a given conformer absorbs a stellar photon that radiatively excites the molecule to electronic states above the interconversion barrier. Subsequent fluorescent decay leaves the molecule in a different conformer form. This mechanism, which we specifically study with ab initio quantum calculations, was not considered in Space before but likely induces structural changes of a variety of interstellar molecules submitted to UV radiation.