Is there a word or phrase for walking into a room to get something but then forgetting what you went in there to get?

Solution 1:

In psychology, it is called doorway effect or location updating effect.

Researchers already know that walking from one space to another makes people more likely to forget tasks when compared to others who don’t make such a transition. Called “location-updating effect” the phenomenon also causes people transitioning between rooms (even virtual ones) to take more time while attempting to recall items from memory.

news.discovery.com

It happens both in virtual and real environments; and it is explained that leaving a place and entering a new one is served as an event boundary in the mind and memory refreshes itself for the new information.

This “doorway effect” appears to be quite general. It doesn't seem to matter, for instance, whether the virtual environments are displayed on a 66” flat screen or a 17” CRT. In one study, Radvansky and his colleagues tested the doorway effect in real rooms in their lab. Participants traversed a real-world environment, carrying physical objects and setting them down on actual tables. The objects were carried in shoeboxes to keep participants from peeking during the quizzes, but otherwise the procedure was more or less the same as in virtual reality. Sure enough, the doorway effect revealed itself: Memory was worse after passing through a doorway than after walking the same distance within a single room.

scientificamerican.com

Solution 2:

Maybe not applicable to all ages, but it's often called a senior moment.

Solution 3:

'Destinesia' is an apt word...creative and fitting in one stroke; destination + amnesia