The simple hydrothermal self‐assembly of metal ions, 5,5′‐(4,5‐dicarboxy‐1,2‐phenylene)bis(oxy)diisophthalic acid (L1'), and N2H4·H2O at pH = 8 (adjusted by oxalic acid) created two new acylhydrazinetetracarboxylate‐extended 3‐D Sr2+ and Ba2+ coordination polymers [Sr2(HL1)(H2O)] (H5L1 = 5,5′‐(1,4‐dioxo‐1,2,3,4‐tetrahydrophthalazine‐6,7‐diyl)bis(oxy)diisophthalic acid) 1 and [Ba5(HL1)2(ox)(H2O)2]·6H2O·N2H4 (ox = oxalate) 2. H5L1 originated from the in situ acylation of L1′ with N2H4. X‐ray single‐crystal diffraction analysis reveals that (i) the 3‐D network of 1 is based on a rod‐like secondary building unit (SBU), which can be described as an alternate arrangement of two types of dinuclear Sr‐O clusters; (ii) the 3‐D network of 2 is also based on a rod‐like SBU. The different is that the SBU for 2 can be described as an alternate arrangement of a kind of trinuclear cluster and a kind of tetranuclear cluster. Both 1 and 2 emit blue light. With regard to their good photoluminescence properties, their trinitrophenol (TNP) sensing ability was investigated. The results indicate that both can selectively detect TNP. The quenching constants Ksv are calculated to be 3.21 × 104 m–1 for 1 and 2.98 × 104 m–1 for 2, respectively.