Recent high-sensitivity observations carried out with the Atacama Large Millimeter Array have revealed the presence of complex organic molecules (COMs) such as methyl cyanide (CH3CN) and methanol (CH3OH) in relatively evolved protoplanetary discs. The behavior and abundance of COMs in earlier phases of disk evolution remain unclear. Here, we combine a smoothed particle hydrodynamics simulation of a fragmenting, gravitationally unstable disk with a gas-grain chemical code. We use this to investigate the evolution of formamide (NH2CHO), a prebiotic species, in both the disk and in the fragments that form within it. Our results show that formamide remains frozen onto grains in the majority of the disks where the temperatures are <100 K, with a predicted solid-phase abundance that matches those observed in comets. Formamide is present in the gas phase in three fragments as a result of the high temperatures (≥200 K), but remains in the solid phase in one colder (≤150 K) fragment. The timescale over which this occurs is comparable to the dust sedimentation timescales, suggesting that any rocky core that is formed would inherit their formamide content directly from the protosolar nebula.