Add Data Row - Expected type is Int32 Problem

I have numbers that I convert to Int64. However in add data row activity, an error occured.

“Value was either too large or too small for an Int32.Couldn’t store <2657174087> in X column. Expected type is Int32.”

How can I solve this problem?


Does this table is created by you or it is from Excel/Web?

I am subtracting the numbers. And try to write them in a new excel with add data row activity.

can you send the screenshot for the Add Data row code?

I’ll suggest convert the number to string, and when ever required to do data operation by simply convert it to integer format!!!

I am using below code in add data row;

{row.Item(“X”), Variable1, row.Item(“Y”).ToString, Variable2, row.Item(“Z”).ToString, row.Item(“ID”)}

Variable1 and Variable2 are also in string format.

HI @aysyavuz

From where the datatable is created? Is it created by using the build data table activity? If so, you can edit the data table data type of the column to hold Int64 value instead of Int32. If the data table is generated through a excel or a web scraping method, and if you want to add the value to the same datatable, I would recommend below steps.

  1. Use Add Data Column - with the data type Int64
  2. Within the for each loop, use Add Data Row as you have now. and assign the int64 value to the new column you created

In case you are adding a new column instead of the column you need, you can delete the old column and rename the new column to the previous deleted column name :slight_smile:

1 Like

Thank you so much to you all. I realize that some of my data in row.Item(“ID”) aren’t string. I convert and it works right now.


1 Like