How to use Argument in Invoke code Python

I am trying to send Email using gmail smtp with invoke code in Python i want to pass the Datatable through argument but how to use it inside the invoke code activity.

I don’t think you can send a datatable as a variable to Python; it only maps simple data types. You could create the body, loop over the data in the workflow, and then send the body as a string. Alternatively, you could save the data to a file and load it from inside Python.

@Allan_Zimmermann I want something like this but columns are change

column would be User and Percentage
can you please elaborate how to iterate and make email body

I think you should be able to serialize the data table into json, pass it as string to invoked python, and deserialize it inside python.

As Allan said, I don’t think data table of .NET can map to python’s dataframe just like that.

I think openrpa uses net framework, so if you get the Newtonsoft.Json nuget package, you can do Newtonsoft.Json.JsonConvert.SerializeObject(yourDT); to get the json string

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.