1 Chronicles 28:9

And as for you, my son Solomon, know the God of your father, and serve him with a perfect heart and a willing mind. For the Lord searches all hearts, and understands the thoughts of all minds. If you seek him, you will find him. But if you abandon him, he will cast you aside for eternity

Other versions

King James Version

And thou, Solomon my son, know thou the God of thy father, and serve him with a perfect heart and with a willing mind: for the LORD searcheth all hearts, and understandeth all the imaginations of the thoughts: if thou seek him, he will be found of thee; but if thou forsake him, he will cast thee off for ever.

English Standard Version

"And you, Solomon my son, know the God of your father and serve him with a whole heart and with a willing mind, for the LORD searches all hearts and understands every plan and thought. If you seek him, he will be found by you, but if you forsake him, he will cast you off forever.

New International Version

"And you, my son Solomon, acknowledge the God of your father, and serve him with wholehearted devotion and with a willing mind, for the LORD searches every heart and understands every motive behind the thoughts. If you seek him, he will be found by you; but if you forsake him, he will reject you forever.