Genesis 22:12b: God is omniscient, yet he said to Abraham, "Now I know . . ." He knows all past, present, and future, so why "Now I know . . ."?
God's Omniscience - Doctrine vs. Bible
You have discovered that Christian doctrine (I.e. “God is omniscient”) and the Bible don’t always align. There are many places, especially in the Old Testament, where God is surprised, expresses regret, and seems to need help in knowing what’s going on. Of course there are also many places where God clearly knows a whole lot more than we do—the chapters where God speaks to Job out of the whirlwind are a key example of that, as well as many places where God knows people’s hearts. So what to make of that?
The passages that support a doctrine of omniscience can also simply be a product of the fact that God, as the Creator of all that is, knows that Creation in a way only the Creator could. God knows our hearts because God made the human heart and knows the way the human mind, heart, and soul are designed to work and how they are prone to go off course. Parents experience this as they get to know their children over time or a married couple comes to know each other so well that they can finish each other’s sentences and pretty much know how the other will respond in a given situation. Our loved ones still can surprise us, but we’re right more often than we’re wrong.
God has been with Creation for millennia. God determined the science of its laws, the depth of our souls, and structured a world where every detail supports every other in a giant web of life. But since we also were given free will, God can also be surprised at our actions. God is so upset at human wickedness in Genesis 6 that God regrets the whole project and decides to wash it away with a flood. The greatest artists will all tell you that they are often surprised by their own work when it takes an unexpected direction. Scientists who are sure their experiments will show one thing are often surprised to discover a different result. God, the greatest of all artists and scientists, seems to have those same moments.
Another way to look at the question is to consider that while God could know everything—past, present, and future—God might choose not to use that power. A human example might be a couple expecting a baby. We have the ability to know the gender of that child before birth, but many couples choose to be surprised instead. Humans are made in the image of God and most humans enjoy a pleasant surprise much more than something we knew was coming. Maybe the love of a wonderful surprise is something we get from God!
I’m not sure that answers your question, but I hope it can give you some perspective and something to look for as you read the Word of God.