[Tex/LaTex] How to add appendix in thesis using LyX

appendiceslyxtable of contentsthesis

I want to add an appendix (questionnaire etc.) at the end of my thesis after the references. I use the article class and work with LyX: Document -> Start appendix here. But I am not getting it in the TOC.

\documentclass[12pt,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{color}
\definecolor{document_fontcolor}{rgb}{0, 0, 0}
\color{document_fontcolor}
\usepackage{babel}
\usepackage{float}
\usepackage{textcomp}
\usepackage{pdfpages}
\usepackage{tipa}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{setspace}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}
\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}

\@ifundefined{date}{}{\date{}}
\@ifundefined{showcaptionsetup}{}{%
 \PassOptionsToPackage{caption=false}{subfig}}
\usepackage{subfig}
\makeatother

\appendix
\noindent \begin{center}
\textbf{Questionnaire (Case Study 1)}
\par\end{center}

Best Answer

In your document, after the chapters, insert the appendix

\begin{document}
    \tableofcontents

    \mainmatter
    \input{chapter1}
    \input{chapter2}
  ...


    \appendix
    \cleardoublepage  
    \input{appendix1}
    \input{appendix2}
     ...
 \end{document}

where the appendix1 is defined in a appendix1.tex file:

%\appendix
\label{ref:appendix1}
\chapter{appendix1}

text