Global variables module

I’m trying to import global variables from a module called GlobalVariablesModule
My form frmMembersMain shows the contents of the Members table in a data grid which has an update button on each row. Clicking an update button fires open_form for the frmAddUpdateMember. The code behind this form imports the globals module and the init function sets one of the global variables, globaluname (declared in the globals module as global globaluname), to a value passed via init. This seems to succeed. When form_show runs and refers to globaluname I get NameError: name 'globaluname' is not defined at frmAddUpdateMember, line 78 as if the import never occured


[**Clone link:**
*share a copy of your app*](https://anvil.works/build#clone:XAPDHV37FTNOOOHL=2SE5D2D2LYDBSDZAHY6VX442)

Welcome to the forum!

When you’re working with values inside another module (that you imported with the from syntax), you need to qualify the name to say which module they’re in. e.g.

GlobalVariablesModule.globaluname=Uname
1 Like

As jshaffstall sad.
Start with importing your module to the form:

from ..GlobalVars import indication_DD, temp_DD, matrix_DD, difficulty_DD

If you start typing “from” and “glob” it should appear in your choice. You can decide what vars you want to import from a module or all of them. I recommend you to decide which you actually need.

Accessing it is easy, setting Drop Down to a list from Global Var:

self.tb_matrix.items = matrix_DD

Thanks Jay. That was exactly what was absent

Ta also KR1. I had read posts debating the number of dots but code completion handled it fine.