"the foregoing discussion" is correct and usable in written English. You can use it when you want to refer back to a discussion that has already taken place. For example: "As discussed in the foregoing discussion, this is our plan of action".
The foregoing discussion has made two accounting statements involving income.
The third movement of "Brown" opens and extends the foregoing discussion.
The assumption in the foregoing discussion was that money wages were at the equilibrium level.
The foregoing discussion has been confined to the price system as it exists in capitalist economies.
Much of the work of a logician proceeds at a more abstract level than that of the foregoing discussion.
The foregoing discussion only hints at many nuanced issues and interpretations at the heart of this controversy.
The foregoing discussion was intended to provide the tools for dissecting and analyzing any specimen of humour.
Since I tried Ludwig back in 2017, I have been constantly using it in both editing and translation. Ever since, I suggest it to my translators at ProSciEditing.
Justyna Jupowicz-Kozak
CEO of Professional Science Editing for Scientists @ prosciediting.com