Getting Error In Add Data Row

Hi,

I have created Build Data Table In Init(first run) and making that datatable variable to entire reframe work(general business)

I have taken add data row activity in before process transaction XAML and the variable was displaying and i was passing in ADD DATA ROW activity. but i was getting error as Object reference not set to an instance of an object

I have checked in local pannel also while debugging its showing NULL

Same add data row activity is working in another sequence…!!

Thanks,
Rishi

Hi @Rishik_Chowdary

Before adding the rows to datatable you need to initialize the datatable first. In the Variables panel for your DataTable add the default value as
new System.Data.DataTable

In case you are using Build datatable activity make sure that you datatable variable is assigned in the property panel.

Regards,
Rajeswari

Thanks @Rajeswari24

But i have assigned the variable but i dont know why it was coming error (In another sequence same add data row is working fine)

I was using build data table activity…!!

@Rishik_Chowdary , Then it might be problem with the data that you are adding as row to the dataTable. Can you use write line or log message activity to print all the columns that are being added to the row. If any of the value id null and you are doing any operation on that null value would cause this kind of error.

Regards,
Rajeswari

Hi @Rishik_Chowdary,

Check your table’s data type and allownull field. In the Add data line, make sure your data type is correct and if allow is null it is not null.

You can get more support if you share the screenshot or the content of the error.

Regards,
MY

check the scope of the variable and ensure that there is no other variable with the same name in other/different scope. Universal search on variables will help for this check

@Rishik_Chowdary Please check below steps

  • Print the variable that you are passing in Add Data Row activity and see what is it giving NULL
  • Go to the variables panel, search for your data table variable and declare the data table(ref screenshot as below)

  • Make Universal Search for the variable so that it gives the list of same variable names in different scopes if there are any

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