0 votes
1 view
in RPA by (12.8k points)

I'm calling a python function using the UiPath Python Activities Pack (Get Python Object) and it returns a DataFrame in order to use it within UiPath. Unfortunately, UiPath is not able to convert the DataFrame to a .Net DataType like a DataTable.

enter image description here

Even when I try to convert the DataFrame to any other format (String, numpy array, html etc.) it is not working although the documentation mentions explicitly that all DataTypes are supported. The Python script does its work and stores the Content of the DataFrame in an Excel file and I could, of course, just read the Excel file. I was just wondering whether there is a way to directly pass the data to UiPath instead of saving it first and reading it again.

1 Answer

0 votes
by (29.8k points)

Below I have explained steps I followed to pass pandas dataframe to Uipath

  • Python Script:UiPath 'Invoke Python Method' activity return the pandas dataframe as a JSON string, i.e.


   return df.to_json(orient='records')

  • Get Python Object: Save the JSON string in a variable of type string
  • Deserialize JSON: Choose 'System.Data.DataTable' as TypeArgument and store the result in a variable of type dataTable

enter image description here

Now the Data from the pandas dataFrame should be available in a .Net dataTable in Uipath

by (100 points)
Hi can you pls send the xaml file for invoke pandas in uipath.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...