I’m having an issue when I try to add data to the datatable using the activity “AddDataRow”.
I have added the “CreateDataTable” activity at the beginning, then after some procedures, I tried to add data to the datatable using “AddDataRow” but the following message appears.
# DataRable cannot be null
Parameter name: DataTable
I’ve checked and the variable is created correctly, is there any reason else why this is happening?
Try adding a breakpoint and make sure it has a value … That would still be my guess … if you can confirm you do not have multiple variables with the same name AND it does indeed contain an instance of a datatable, i would like to see an example workflow showing this issue.
I did what you suggested, and after some investigation I found out that the datatable was changing its value to
What seems really strange is that it’s happening right after the workflow executes an “Invoke Code” activity with python code, and after removing it (but I need it ), the process starts to work normally.
This code uses regular expressions to generate a template name based on a given file name/path.
Hmm, I should properly add a “map variable” dialog to invoke code at some point. I hope you can find a work around until then.
are using same variable in python ? and what is variable type in python? if it is data frame than we cant convert datatable to dataframe.
You can convert dataframe to JSON and Json as string in openrpa and convert that into datatable
Possible to share openrpa code and python code?
@Allan_Zimmermann I will try to find a different solution. Thank you.
@yashshah I already checked and the valiables have a different name and type.
I will try to share the workflow later.
I was able to create a small demo reproducing the same issue.
If you delete or change the “Invoke Code” location the workflow will work perfectly.
DemoGetSurvey.xaml (6.3 KB)
@kowts @Allan_Zimmermann I am facing same issue however I found a work around for this you can copy Python code into separate workflow and invoke that workflow I think invoke Python code causing mapping a variable issue openrpa workflow memory.
@yashshah is correct. The solution is me adding a “map variables”. Until then you must create the datatable after invoke code, or use yashshah‘s trick.
the work around that @yashshah indicated works perfectly, many thanks.
@Allan_Zimmermann I will use the work around for now, until we have a fix released.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.