The Prophet - That is, the prophet whom they expected to precede the coming of the Messiah - either Elijah or Jeremiah. See Matthew 16:14.
Related Commentaries of John 7:40
John 7:40
40 Many of the people therefore, when they heard this saying, said, Of a truth this is the Prophet.