An aggregation technique for constraints with values in Hilbert spaces is suggested. The technique allows us to replace the original optimization problem by a sequence of subproblems having scalar or finite-dimensional constraints. Applications to optimal control, games, and stochastic programming are discussed in detail.