You can have another button whose visibility is the same as label but this time set their visibility to:
If(CountRows(Gallery.AllItems)=0 && popVar, true, false)
Set the popVar variable to true on the OnVisible property of the screen.
Then the OnSelect of the button can be:
Set(popVar, false)
This will hide the label and button.
One last thing would be to add this to the OnChange property of your text input control where the user is expected to enter a document number.
Set(popVar, true)
This will ensure that theis variable resets and is ready to show or hide the popup based on the new document number entered.
Let me know if this helps.
---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.
Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com