Abstract The structural origins of ion recognition by electrochemically addressable poly[Ni( salen )] thin films are explored using in situ X-ray spectroscopy. XANES and EXAFS provided the local environment (nearest and next-nearest neighbours) around the Ni atom and solution-derived Ba 2+ bound to the film. The Ni is covalently bound to two N and two O donors in square planar geometry, irrespective of film redox state and the presence (or absence) of bound Ba 2+ . The role of the Ni is purely structural; dramatic changes in i – E response accompanying Ba 2+ uptake are assigned to the delocalised poly( salen ) polymer spine. Ba 2+ is trapped in a pseudo-crown formed by two methoxy O donors and two O donors shared with the Ni atom. The Ba 2+ EXAFS signal from thick films (10 μm) is significantly below that anticipated from electrochemical observations on thin films ( 2+ access to the outer region of the film; surface sensitive XPS data confirm this. Combination of spectroscopic and electrochemical data suggest that, for exposure times of ca. 10 3 s, only sites in the outer ca. 1 μm of the film are occupied; the implied diffusion coefficient of 10 −11 cm 2 s −1 is consistent with a relatively compact solvated film.