Assign: There is no row at position -1

image
Im adding data into the excel when certain conditions are met im using the statustracker dt as an data table and status row index as statustracker_dt.row.count-1 in order the bot to fill up if there is any empty spaces

@madhavraichur25

Please check your statustracker_dt.row.count is empty or not.Means your datatable contains any rows ,except Headers

Hi @madhavraichur25

Can you try the below syntax once.

In_StatusTracker_DT.Rows(In_StatusTracker_DT.Rows.Count - 1)("Mortgage Expiry Date") = "Your New Value"

Check whether In_StatusTracker_DT has data using Immediate Panel while debugging and try to execute the syntax in Immediate Panel and check.

Hope it helps!!

Hi @madhavraichur25

Method -1:
→ Use for each row in data table and provide the data table variable in that activity.
→ In body give the condition as CurrentRow("Mortgage Expiry Date") = Offer_Expiry_date.Trim
→ If there is any condition to check then please place an if condition in the body and then place the above syntax in that if condition.

Method -2:
→ Place an if condition and give the condition as In_StatusTracker_DT.Rows.Count>0
→ If the condition is met then it will go into the then block and in then block please give all the steps you have done within that then block. So, if the rows count is greater than zero then only the bot moves into the then block and will do the actions as provided by you so please place all the steps you have done within that Then block and it works!!

Regards