Let $U: \mathscr{A} \to \mathscr{C}$. If $\mathscr{E}$ has (enought large) limits resp. colimits then the functor $U^*: CAT(\mathscr{C}^{op}, \mathscr{E} ) \to CAT(\mathscr{A}^{op}, \mathscr{E} ): P \mapsto P\circ U^{op}$ has a left adjoin $U_!=Lan_{ U^{op}}$ (puntual Kan extention) resp. a right adjoint $U_*=Ran_{ U^{op} }$ and $U_! \dashv U^* \dashv U_*$ with $U_!(P)(X):= {\underrightarrow{lim}} (P\circ \pi^{op}: (X\downarrow U)^{op}\to \mathscr{A} ^{op}\to \mathscr{E})$
$U_*(P)(X):={\underleftarrow{lim}} (P\circ \pi^{op}: (U\downarrow X)^{op}\to \mathscr{E} $ ).
Let $\mathscr{E} =Set$ and $\mathscr{A}, \mathscr{B}$ small (we can have more general conditions for the existence of puntual Kan extentions) , we have
$U_!(P)$= $Lan_{ h_-} (h_U)(P)$ =
$\underrightarrow{lim}$$_{(A, a)\in \mathscr{A} \downarrow P }$ $h_{ U(A)}$,
$U_*(P)(X) =\mathscr{A} ^>(h^U_X, P)$
indeed:
$(\underrightarrow{lim}$$_{(A, a)$ $h_{U(A)}, Q)\cong$$(\underrightarrow{lim}$$_{(A, a)}$ $h_{U(A)}, Q)\cong$,
$ {\underleftarrow{lim}}_{(A, a)} QU(A)\cong $
$({\underrightarrow{lim}}_{(A,a)} h_A, Q\circ U)$ ;
$(Q\circ U, P) \cong ({\underrightarrow{lim}}_{(X, x)\in \mathscr{C}\downarrow Q } h^U_X , P) \cong {\underleftarrow{lim}}_{(X, x)} (h_X, \mathscr{A} ^>(h^U_-, P)) \cong (Q(-), \mathscr{A}^>(h^U_-, P))$.
Then (answere for you): $U_∗(h_Y)(X)=(h^U_X,h_Y)$.