Context: I am using a python script which loops through list of sheets in an excel file to carry out list of checks.
Now, list of sheets & checks will vary based on user’s choice collected through forms.
Problem: I am passing 2 strings (paths) and 2 lists( sheet_list & checks_list) as arguments to python script. But it fails every time at Invoke Python method saying, “One or more errors occurred.”
Python script independently through MS Vscode is running as expected.
Please guide on how to pass 2 string and 2 list arguments to the script.
That is another issue, Anil. Output python object ( result variable ) from Get Python object every time gives error stating, Cannot convert Python object. I tried by using variables of type data table, object, string.
For now, my python script will only return exception in case it occurs inside the script and there is no output as such.
Script takes list of sheets as input. Go through all cells of those sheets and perform some basic checks such as if cell contains negative formula, complex formula, only formula, hardcoded value etc. Which checks to perform is also expected as input as a list.
Later, script writes all identified cells with sheet names, value and formula into an excel file.
Yes, from this and other bot what I have understood is passing any Collection (List, Datatable, etc) gives error whereas arguments Int, String are compatible with the invoke python method activity but not collections.
I modified the code to write list in text file from UiPath which will be read by python hence removing need to list argument keeping only String arguments. This is working.
Need update in Python activity probably to overcome this issue if I am correct to understand it.
As to the issue, I finally found some time to experiment a bit and I was able to make it work with a string and an array of strings with a sample script:
It would seem like you can add arrays to the list of supported conversions.
But indeed, even in this sample, I return the dictionary as a string, because it cannot handle the conversion between the python dict and .net Dictionary (as another example of the limits).
We will have a look what can be done here, but for anyone who is really impatient, the Python activities code can be viewed over here: