Functions added to the JavaScript section for a module work while viewing the module, but once it is added to an app- the JavaScript Functions are not in scope anymore.
Here is the function declared on the Module Level:
Does window.updateData work? I've found that things defined in the Javascript section of the app like that almost always resolve that way.
If not, you'll need to create some sort of exposed output from the module that calls updateData. Retool is pretty aggressive at sandboxing components from each other.