Hey @jasoncaunt
Welcome to the Postman community! 
Would you able able to share more about the function itself and maybe a screenshot of the different areas that you have that in the app?
Just trying to visualize what you’re doing 
Also, would getting the function this way help?
eval(pm.globals.get("globalFunction"))
This thread might add some extra information into getting something working: