Python: Take Inputs on RoboCloud from the user running task

I am new to the RoboCorp community and after going through older threads and documentations, I was still unable to find any means of taking a user input on RoboCloud when a process is run. I am not sure if this is something even possible and hence I thought this will be the right place to confirm.

My requirement in this regard wouldn’t be much, I just need a way to be able to provide a list of inputs when I run the process. Even the ability to do so at the very beginning will work fine with me. The inputs can be like username and password in case it is an automation that deals with logging in to a web platform.

My scripts will primarily be in Python, but if there is even a way to take inputs in the .robot file and somehow read them/pass them as parameters to the Python script, that will do for me too.

Creating an environment variable for this is not a preferable solution as the inputs can be different each time and I wish for someone with no technical knowledge/programming experience to still be able to run the processes whenever required.

Any help will be appreciated. Thanks!

2 Likes

Hello @spirit,

thanks for your question. The need you are describing makes perfect sense, and the feature you are requesting is currently on the roadmap and under development.

At the moment, there is no UI-based way to trigger a process passing inputs into it, but you can do it via the API and the Robocloud.Items library, details in this article: https://hub.robocorp.com/knowledge-base/articles/using-data-passed-via-robocloud-process-api/

So, until the UI is released, a possible (less practical than the upcoming ui) way you could build your own UI that triggers the process via that API, or tell your users to use something like postman https://www.postman.com/downloads/ or Insomnia https://insomnia.rest/

hope this helps!

2 Likes

As Mario mentioned this is not yet supported when using cloud based worker. Not sure if this is a strict requirement for you.

What you can do is to run Worker locally on your machine and then use Dialogs library for user inputs.
It has following keywords:

${username} =	Get Value From User    Input user name    default
${password} =	Get Value From User    Input password    hidden=yes

When Worker runs the script the execution is paused and a dialog asking for the input is shown. Script then continues after filling the data.

It is even possible to do just this step (e.g. ask credentials) with local worker and let other part of the process run with cloud workers.

1 Like

Hey @Mario,
Thanks for the quick response. Glad to know this feature is on the roadmap.
Thanks for sharing the API docs, I shall look into it, will probably develop my own frontend for this purpose for the time being if the need is urgent.

Thanks again! :slight_smile:

1 Like