Christian greetings,
Good question, hopefully, you ask for the right reasons. Yes and no. God is indeed omniscient aka "all knowing", however, he chooses to limit his foresight aspect in regard to some future events. Some ignorant Christians often shun this Idea as they believe it limits God . Their belief is that God has no limits, however, it is clearly rooted in scripture that God limits himself (I'll show proof of below). These same Christians also believe that God is omnipotent (ALL POWERFUL), but this is also not true, there are some things God cannot do. God cannot lie, God cannot die, he can not do evil as it's against his character and so on. Funnily enough, if God were omnipotent then he would have the power to limit his knowledge in some way thus contradicting those who believe that God cannot limit himself and must always know everything that is going to happen. But I digress.
The account of God's test onto Abraham is one place in the bible that demonstrates God limiting himself to knowing future events. I'm sure you're familiar with the account. I'll post the part of the chapter for context sake. Genesis 22:1-12.
1Some time later God tested Abraham. He said to him, “Abraham!”
“Here I am,” he replied.
2Then God said, “Take your son, your only son, whom you love—Isaac—and go to the region of Moriah. Sacrifice him there as a burnt offering on a mountain I will show you.”
3Early the next morning Abraham got up and loaded his donkey. He took with him two of his servants and his son Isaac. When he had cut enough wood for the burnt offering, he set out for the place God had told him about. 4On the third day Abraham looked up and saw the place in the distance. 5He said to his servants, “Stay here with the donkey while I and the boy go over there. We will worship and then we will come back to you.”
6Abraham took the wood for the burnt offering and placed it on his son Isaac, and he himself carried the fire and the knife. As the two of them went on together, 7Isaac spoke up and said to his father Abraham, “Father?”
“Yes, my son?” Abraham replied.
“The fire and wood are here,” Isaac said, “but where is the lamb for the burnt offering?”
8Abraham answered, “God himself will provide the lamb for the burnt offering, my son.” And the two of them went on together.
9When they reached the place God had told him about, Abraham built an altar there and arranged the wood on it. He bound his son Isaac and laid him on the altar, on top of the wood. 10Then he reached out his hand and took the knife to slay his son. 11But the angel of the Lord called out to him from heaven, “Abraham! Abraham!”
“Here I am,” he replied.
12“Do not lay a hand on the boy,” he said. “Do not do anything to him. Now I know that you fear God, because you have not withheld from me your son, your only son.”
Notice here it is God testing Abraham's faithfulness as to whether he will sacrifice his son Issac, this is God's test, and he uses an Angel as an agent to oversee his test clearly shown in verse 10 "
But the angel of the Lord". Now assuming as some would that God is all knowing it is simple to question why God asked Abraham to sacrifice his son if he is indeed "all knowing", surely he knew the character of Abraham and that he would. But as shown in verse 12 he didn't know this, God says "Now I know you fear God", this clearly expressing that previously God did not the outcome but since Abraham demonstrated the desired faith that he now does.
To add the context also expresses the same idea. The contextual narrative of this verse being Gods test on Abraham. Tests are used to asses an unknowm outcome, if the outcome of a test was known before a test is carried out then why take a test. Clearly God wanted to know the result of the test and had no pre-knowledge thus limiting himself.
Some would argue that it was the Angel that didn't know, however notice what the Angel says in the latter part of verse 12 "
Now I know that you fear God, because you have not withheld from me your son, your only son" . These are clearly Gods words and not the Angels, to suggest otherwise would be to foolishly to suggest that Abraham was making the sacrifice to not just God but also to this unkown Angel.