take a notion v. phr. To get a sudden idea; decide without thinking.
The boy suddenly took it into his head to leave school and get a job.
Grandmother keeps a bag packed so that she can go visiting whenever she takes a notion. [TahlilGaran] English Idioms Dictionary ▲