Variable scope in framework

@epinder, hello and welcome to the community

The below thread has some interesting suggestions on how to achieve this, please check it out and let me know if it helps: