Get Python Object Cannot Convert Python Dictionary

I would like to covert a Python Dictionary Object to a .Net Dictionary Object.

The “Get Python Object” Activity errors out regardless of the type argument I try. I have tried convert to Object, to Dictionary (of Object, Object), to List (of Tuple), etc. and every combination therein.

Nothing works, and my Python method is very simple for testing purposes:

def return_dict():
  dict_fields = {"this": "that", "that": "this"}
  return dict_fields 

Would really like a solution to this. Is this a bug or is there a correct Type Argument I should be using?

For troubleshooting info: Get Python Object works when converting a Python List to Object.

1 Like

Good question,

I have a similar issue with trying to return a dataFrame. I thought I could convert it into a dataTable but it even does not work, when converting the df into a string or another dataType. Would appreciate if someone could provide some experience on how the pass objects between uiPath and Python.

I have the same problem. I have tried to convert lists, dictionaries and data frames all of which give me the same error. The only function return I have been able to use is a string and this limits the functionality.

1 Like

You can try to explicitly convert the Python Object to any specific .NET Object.

You can try the below approach:-

  1. Using “Get Python Object” activity convert the Python object to .NET Object. Keep the “TypeArgument” as Object so that the .NET Object is of type Object.

  2. Once we have the .NET Object we can cast/convert it into any specific type.


Please go through the link below:-

This might also be helpful:

is it TryCast(variable, datatype)
datatype- String, int, dict ??


Please go through the link below:-