you could do it like that get Datatable row names array length get ref from the the same array and set the index to the previous index+1/-1 plug the ref into row name.