We give a variational formula for the Chern-Simons invariants for a given bundle on a simplicial set with a connection using prismatic subdivision.