Update Row Item First Name: Value Cannot be null. (Parameter 'row')

I’m getting first name and last name from screen scraping and doing some string manipulation and I’m using an Update Row Item but im getting the error that name cannot be null. I have the column header correct, i copied and pasted from the build dt activity. So i don’t know what can be causing this. Thank you in advance!

image

Hi @olmccb,

Check how many rows are available your datatable(finalContactDT)? and check whether your dtRowIndex variable value comes under your datatable row count.

Regards,
Robin

Hi @olmccb

  1. Check the column name: Double-check that the column name in the Update Row Item activity matches the column name in the Build Data Table activity. Make sure that there are no typos or extra spaces in the column name.
  2. Check the data table: Check the data table that you are updating to make sure that it contains the correct headers and that the column you are updating is not empty. You can use a Read Range activity to read the data table and a Write Line or Log Message activity to check the contents.
  3. Check the data type: Check the data type of the name column in the data table. If the data type is not set correctly, it may cause issues when updating the row. Make sure that the data type is set to string.
  4. Check the row number: Check the row number that you are updating to make sure that it exists in the data table. If the row number is greater than the number of rows in the data table, you may receive a null error.

Regards,
TuanNNA

hello @Tuannna1 and @Robinnavinraj_S here is my dt


and a few lines below is

Hi,

Can you try to use AddDataRow activity before use UpdateRowitem?

Regards,

@olmccb

You need atleast one row to update a datatable. If you want to add a new row on your datatable, you have to use add data row activity

Regards,
Robin

@Robinnavinraj_S yea when you build the dt you have the first row that says “test” and i deleted it…but before that it was giving the same issue

@Yoichi i dont want to use add data row because each person will not have all the values for the column headers…

oh @Yoichi i see what you mean…i got it…sorry for that

Can you check the dtRowIndex value because starting row index of datatable is zero(0), if the dtRowIndex value is greater than 0 means change it zero and try again. If not please check the column name of your datatable. Copy the datatable column value and paste it inside update data row activity because sometimes you may have missed whitespaces

Regards,
Robin

@Yoichi and @Robinnavinraj_S , thank you the add data row worked…now i get object reference not set to an instance of an object :neutral_face:

please share you error and your activity screenshot

image

Looks like your datarow variable is empty, please assing a value before thje add data row

1 Like

sorry @fernando_zuluaga , not understanding your response. can you please flesh it out a bit for me…thank you

you dataRow variable is empty at the moment you are trying to add into the datatable using the add data row activity, we can add empty values, can you check the value of your dataRow variable before add it?

ok thank you.

@olmccb
How your are assigning the datarow value ?

i created another build dt activity, and now it has the first row with ‘test’ in the first cell of the first row and am still getting the same error

image
image

Hi @olmccb ,

Check this below workflow attached, this might help you in solving your issue’s
Uipath_UpdateRowItem.xaml (11.7 KB)

Hope this may help you :slight_smile: