In this article given y : [0, η) → H , a continuous map into a Hilbert space H , we study the equationŷwhere c(s, •) is a given "potential" on C([0, η), H ). Applying the transformation y →ŷ to the solutions of the SPDE and SDE underlying a diffusion, we study the Feynman-Kac formula.