Table of Contents is empty even though I have applied styles (Heading 1, etc.). Help!

I insert a table of contents but all I get is the title “Table of Contents” and nothing else. It’s a long document with numerous headings to which I have applied headings styles. Why won’t the table of contents generate?

I have tried it as a .docx and as a .odt file.

In case it somehow matters, the document was generated as a compiled document from scrivner.

Never mind… I got it to work.

Looks a duplicate of this question.