How to add variable to a existing datatable


I have a dataTable with few missing column information for e.g as below:

ColumnA ColumnB ColumC
Value1 Blank Value2

Now I have to add value in columnB which is a variable value getting from other source.

I am trying using ‘Assign’ activity as ‘‘dataTable.rows(0).item(1) = myvariable’’ but this is throwing an error stated :- “Object reference not set to an instance of an object. This error usually occurs when using a variable with no set value(not initialized”.

Please advise

1 Like


The Datatable is already fulfilled with information before you’re adding this new value?

Have you tried to run the Datatable through a For Each Row Activity, then use the assign with “Row.item(“Column”) = myVariable” ?


1 Like

No actually Column B is blank, there is no information and I have to add info there.

Also, I have tried row.item(“columnName”) = my variable inside for each row activity but giving me the same error… Please suggest

hey @rk.sati

I don’t know what is going wrong at your end…:wink:

please find the attached sample for you and let me know… if still their is doubt … :slight_smile:

Datatable col_val_assignment sample.xaml (8.1 KB)



Thank you Aks!

But I am not able to download the xaml file. When I am clicking it to download, it is routing me to different page with contents as below:


<sco:Collection x:TypeArguments=“x:String”>

Please suggest if you have any idea or may this is my system issue.

Hey @rk.sati

This has been addressed in many posts :slight_smile:

just right click on the attachment and Save As and rename it as per your convention :slight_smile:


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