%&xelatex
% !TEX program = xelatex
\documentclass{book}

\usepackage{polyglossia}
\usepackage{fontspec}
\usepackage{noto-mono} % to support hyperref package
\usepackage{amsmath,amsthm,amssymb,mathrsfs,amsfonts,dsfont}
\usepackage{hyperref}
\hypersetup{
    colorlinks=true,
    linkcolor=blue,
    filecolor=magenta,
    urlcolor=blue,
}

\usepackage{datatool}

\author{Some}
\title{Any}

\begin{filecontents*}{data.csv}
PK,Value
1,Val1
2,Val2
\end{filecontents*}

\DTLloaddb{values}{data.csv}

\ExplSyntaxOn
\NewDocumentCommand{\getValue}{m}{\DTLfetch{values}{PK}{#1}{Value}}
\ExplSyntaxOff


\begin{document}

\frontmatter
\tableofcontents

\mainmatter


\chapter{AAA \getValue{1}}
\chapter{BBB \getValue{2}}


\end{document}
