Four kinds of polyoxometalate (POM)-viologen compounds were synthesized by hydrothermal method, namely (1−cby. These four POM-viologen compounds exhibit one-dimensional supramolecular network structures. Especially, compound 3 contains a rare sandwich POM subunit {Co 4 (H 2 O) 2 (PW 9 O 34 ) 2 } 10− . These four compounds can be used as color-changing materials, and they all exhibit noticeable color changes upon exposure to light, heat, and electricity. The discoloration mechanism involves viologen derivatives with electrondeficient properties accepting electrons from POM with electron-rich properties under external stimulation, leading to the formation of viologen free radicals. Among them, compounds 1 and 2 also have good properties for ink-free erasable printing, double anticounterfeiting, and ultraviolet detector because of their rapid color response to ultraviolet (UV) light. In addition, compounds 1−4 also show different color changes in the detection of volatile amines.