Handling variable changes in Invoke code containers

Created by akaBot Support, Modified on Thu, 25 Jul, 2024 at 2:03 PM by akaBot Support

Question: Normally, in Invoke Code, an inArgument would pass the variable into the Invoke Code Container. If we change the value inside the Invoke Code, it should not affect the original value outside Invoke Code. However, this is not the case for DataTable variables. Why?


Answer:

  1. Variable Behavior in akaBot:
    • In akaBot, variables are .NET types. The behavior of variables when passed as arguments (InvokeCode, InvokeWorkflowFile) follows Microsoft .NET specifications.
  2. Basic Types:
    • Basic types like Integer, Strings, Boolean, DateTime, etc., will not have their values changed outside of InvokeCode if specified with the [In] direction.
    • However, if these basic types are used as arguments with the [In/Out] direction, their values will change.
  3. Complex Types (e.g., DataTable):
    • For complex types like DataTable, the value outside of InvokeCode will change if modified inside InvokeCode, regardless of the argument direction specified.
  4. Reference for More Information:
    • For more detailed information on .NET variable handling and specifications, please refer to the Microsoft documentation: Data Types in .NET

By understanding these behaviors, you can better manage variable values and their changes when using Invoke Code in akaBot.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article