If you are using get text and invoke code activity in same workflow, just check the Scope under Variable tab.
If you are getting text from another workflow and invokde code is another in workflow, then at first invoke workflow where you are getting text, store the output in out argument
after that create a variable where you are mapping these two workflows, after in second wokrflow(invoke code) create in argument, whenever you used invoke workflow there you need map with created variable to out argumet at 1st invoke workflow after that in second workflow you need to map same variable to in argument..
Happy Automation!!