Yes, you can create code to handle this.
Back in 2021 we talked about this and there was some code shared in this topic: