Adding appropriate table number variable in indexField function call