This invention provides a compound of the formula (I):or a pharmaceutically acceptable salt thereof, and compositions containing such compounds and the use of such compounds for the manufacture of medicament for gastroesophageal reflux disease, gastrointestinal disease, gastric motility disorder, non-ulcer dyspepsia, functional dyspepsia, irritable bowel syndrome (IBS), constipation, dyspepsia, esophagitis, gastroesophageral disease, nausea, central nervous system disease, Alzheimer's disease, cognitive disorder, emesis, migraine, neurological disease, pain, cardiovascular disorders, cardiac failure, heart arrhythmia, diabetes and apnea syndrome.These compounds have 5-HT4 receptor agonistic activity, and thus are useful for the treatment of gastroesophageal reflux disease, non-ulcer dyspepsia, functional dyspepsia, irritable bowel syndrome or the like in mammalian, especially humans.