  The role of the triangle mechanism in the decay process $B_0\to J/\psi K^0f_0
\to J/\psi K^0\pi^+\pi^-$ and $B_0\to J\psi K^0a_0\to J/\psi K^0 \pi^0\eta$ is
probed. In these process, the triangle singularity appears from the decay of
$B^0$ into $J/\psi\phi K^0$ then $\phi$ decays into $K^0\bar{K^0}$ and
$K^0\bar{K^0}$ merged into $f_0$ or $a_0$ which finally decay into $\pi^+\pi^-$
and $\pi^0\eta$ respectively. We find that this mechanism leads to a triangle
singularity around $M_{\rm inv}(K^0f_0(a_0))\approx1520\ {\rm MeV}$, and gives
sizable branching fractions ${\rm{Br}}(B_0\to J/\psi K^0f_0\to J/\psi
K^0\pi^+\pi^-)=1.38\times10^{-6}$ and $ {\rm{Br}}(B_0\to J/\psi K^0a_0\to
J/\psi K^0\pi^0\eta)=2.56\times10^{-7}$. This potential investigation can help
us obtain the information of the scalar meson $f_0(980)$ or $a_0(980)$.
