This question
Did God know the holy place right away during the exodus?
ask around the idea that G-d would choose His holy places during exodus time.
However, if he knows the future, he couldn't possibly undecided during exodus.
So what's the explanation.
Say I said, "I will choose which cake I will eat." That means I do not know which cake I will eat yet right?
In fact, one of the answer on that previous question says that it's actually David, rather than God that latter chose Jerusalem as a holy place.