Robotic Process Automation (RPA)

Robotic Process Automation (RPA)

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

Run Python script using IBM RPA

By Tarcio Alonso Mota posted yesterday

  

IBM Robotic Process Automation currently allows you to execute Python scripts.

The runDOSCommand extends the capabilities of IBM Robotic Process Automation by allowing advanced users to create specific functionality/code in Python and integrate it into pre-existing IBM Robotic Process Automation flows.

This functionality is not fully integrated and there are some restrictions on the types of parameters that can be passed or obtained from the Python script.

 

To send values to the Python script, you need to pass them as parameters (text or numeric) in the runDOSCommand. The parameters must be converted to the specific type directly in the Python script

To receive values from the Python script, you must use the print() Python's method. You can get the output of the Python execution and save it in a variable. After that, you can use the getRegex command to get the specific value from the output.

 

Example 1 - Simple example using Python to perform a math operation

Python script:

IBM RPA script:

You can download the scripts from here and here.

 

Example 2 - Working with complex types (Table/JSON)

Python script:

IBM RPA script:

You can download the scripts from here and here.

 

#IBMRPA #Python #integration

0 comments
27 views

Permalink