Automation Arguments in OpenBots Studio

One critical feature of many automations is the ability to take an argument from the server or other script files to configure how it’s going to run.

To give you a demonstration on how we implemented arguments, I have here a basic project with two scripts in it. We have a main script with one argument containing just main text that will populate the Show Message box. Because this is an argument and a main script file, this will be passed in from the Server during attended or unattended execution when deployed from there. You can see its default value is “Hello, I am the Main!”

We have in our subscript the ability to show some passed-in text from an argument. In this case, it says “I am the default value!” by default, but when we set a Run pass, we will get a different value. And here you see running just that script, it provides the default.

Going to our Main, when we invoke Run Task, we are telling it that it was tasked from the main script, so we’re running from our main execution. We’ll see “Hello, I am the Main!” from our default text and then we will see that it did populate that text properly from the main script. Because it is an in-argument that passes the data to the subscript, we also support out-arguments and in-and-out-arguments as well as other types of arguments to pass data between your scripts.

Going to how arguments populate to the server, it starts with the automations. When a new automation is created in the server, you have the ability to provide a set of arguments that you want it to pre-fill within the schedule. So here, going to the argument demo, we see that “I am the Main” argument corresponds to the name of my main script file argument with the default value “I was invoked from the server!”

When I go to create a schedule, for example, if I select that automation, by default it will populate my scheduled parameters, which are the default arguments that will be passed to the scheduled execution script. When I go to run my schedule, I can change this value on the fly as well, although it does pre-fill to give me the opportunity to just click the proceed button.

Once I click proceed, if I go to my jobs, we’ll see a new job has been created for the agent to run on the server. And it will be assigned to the agent. Once the agent comes in and recognizes that a new job has been added for it to execute, it is downloading the package, unpacking everything, and setting up. Now that it’s in progress it has begun executing, and here you can see our message box saying that it was invoked from the server.

If you would like to be trained by our developers CLICK HERE and select one of our Citizen Developers Jumpstart programs. If you want individual training select the SOLO Jumpstart and if you want to train your team select the Team Jumpstart.

Newsletter Bot

Lets stay in touch!

Join our weekly newsletter and follow us on social media.

Contact Sales
Call Our Experts!