I have seen two methods used here and on youtube to get the expanding foam under the deck..when replacing a deck.
One is to pour the foam into the wells between the stringers and ribs and cut down to make it flat with the stringer height.
The other is to install the deck, drill holes in it...