Support > Forums > OpenBots Studio > How to create Global Variable

How to create Global Variable

Lakshman Duggineni

  • Reporter
  • Calender Icon September 08,2021 at 3:35 PM

Now we can able to create a variable, but it is visible to that script itself. How to create a variable that should be visible to all the subscripts and Main script (Like global variable). Please help with this! Thank you.

This forum has 317 topics, 687 replies, and was last updated 4 months ago by Nataly Alvarado...

Nataly Alvarado...

  • Participant
  • Calender Icon September 10,2021 at 5:05 PM

Hello Lakshman,

in OpenBots Studio we have support for 2 types of variables: local variables and arguments.

Local Variables: created through the variable pane. Their scope is limited to the script where they are created. Arguments: created through the argument pane. Used to store data dynamically, this data can be passed between obscripts, from one script to another. User is able to set specific direction (In/Out/InOut), that dictates which direction the data will flow.

For instance, if you need a variable to be accessible in Main and all subscripts. You will need to create the variable in main, and pass this to all subscripts as an argument.

Hope this helps!

You are not authorized to reply, please click here to login and add your reply to this topic.