"We had decided to eat it."
Translation:Vi havde besluttet at spise den.
Here, it depends on the grammatical gender of what "it" refers to.
In "Vi havde besluttet at spise grøden" (we had decided to eat the porridge) you can replace "grøden" with "den" but not "det" because "grød" is common gender.
In "Vi havde besluttet at spise brødet" (we had decided to eat the bread) you can replace "brødet" with "det" but not "den" because "brød" is neuter.
At least, I believe that covers it. As a native Dane I was never actually taught this technical stuff about gender. We know what sounds right but not always why :)