Why does it not work?
Because you first converted backrow variable to a String type
Row_Count.Rows(Row_Count.Rows.Count-1)(0).ToString . Therefore, adding 1 will give you either an error or if using GenericValue type add it to the end of the string.
- I also think there is a nested for loop there so you get “11” in the message box.
- I am suspecting you are using
GenericValue argument type for your
backrow variable. Usually when you try to add an
Int to a
String, UiPath will give you a error notification as below. This notification does not show up when argument type is
GenericValue. I suggest you do not use
GenericValue types when using loops.
backrow = Convert.ToInt32(Row_Count.Rows(Row_Count.Rows.Count-1)(0).ToString)
backrow here is of Int32 argument type.
This will treat 3742 as an
Int type and will allow increment operation.
Here is a workflow for your reference: IncrementValue.xaml (6.4 KB)