I have a problem using Invoke Code

Hello, I have a problem using Invoke Code. I set a variable to receive a value from Gettext with the variable Credit1 and set it in the Edit argument in Invoke Code, but it doesn’t receive the value as a parameter. How can I fix this? Because another project has @credit

image

Hi @thawatchain
Welcome to the Community

Could you show the Arguments panel of the Invoke Code?

It should appear like this:

The paramater must appear with that [@] symbol

NOTE:
You must use the Name from the argument when calling inside Invoke Code:

As you can see below, When I call inputString it does Not appear. But when i call Credit, it appears.

Hello @thawatchain

make sure that the scope of “credit1” variable is in sequence of invoke code.


Sure I take Credit1 from Variable and set Credit as a variable in vb. In another project I have Parameter but in this project I don’t have Parameter. I am very confused.

Thanks for your help. For Scope, I set it to cover the whole project.

1 Like

@thawatchain

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!!

Hi, could you set a breakpoint before the Invoke Code activity to check if the variable Credit1 contains any values?

Hi, Credit1 has values ​​from a project-wide Variable (Gettext > Variable > Edit Argument), but no Parameters.

Replace the existing Invoke Code activity with a new one and verify if it appears correctly within the newly created Invoke Code activity.

1 Like

Thanks for the help. Now there is no other Parameter that my other projects can call but the current project does not. Is it possible that UiPath is an old version?