Input string format

Main.xaml (106.6 KB)


Is the error occuring because there is a space before the numbers in reviews columns, I tried to replace it using assign but there is no change.

Hi @darshanb.is22

Change the code like this

(From row In dtt.AsEnumerable() 
  Order By CInt(row("Reviews").ToString().Trim()) Descending, CInt(row("Price").ToString().Trim()) Ascending
  Select row).CopyToDataTable()

Use trim to avoid the spaces.

Hope it helps!!

1 Like

You can add trim or used
CInt(row(ColNameOrIndex).toString.Trim)

We recommend not relying on Excel and checking the datatable directly within the immediate panel

Similar we had done analysis tasks for dates

we can analyze int32 issues like

dtDataVar.AsEnumerable().Where(Function (x) Not int32.TryParse(x(ColNameOrIndex)toString.Trim)))
1 Like

Thank you it worked perfectly!

1 Like

It’s my pleasure… @darshanb.is22

Happy Automation!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.