Serial numbers in list

There is a certain list in which you need to arrange serial numbers, you need to do this through do While, the order should begin with 00001 and then 00002 … 01555, what should be the expression on VB
image

@NastyaL

Is it web application ?

Have you tried with Type Into activity ?

Hello @NastyaL

Are trying to sort the table in the application in as ascending order? Or are you trying to enter the serial number in ascending order to the blank cells you have in the application?

If you are to enter the values, then use Type into. If not I think Click activity will help you sort the list

I need to enter a serial number for each line so that there is 00001 in one line, 00002 in the second line, 00003 in the third line and so on. I can enter through the into type, but I need a code on the VB so that the program understands which serial number to put down.

1 Like

Hi @NastyaL,

I assume you have all your serial numbers in a string array, then in the for each you can try with this

yourStringArray.OrderBy(Function(a) Convert.ToInt32( a))

Here are the steps to follow @NastyaL,

  1. Initialize a variable of type int and assign the value as 0001 (assume SerialNumber) for the first time and another variable of type int and value as 1 (Count assume)
  2. Get the selector of the first box and check it with the selector of the second. You will get what needs to be dynamic in the selector.
  3. Loop through the number of values you have on the screen and write the serialNumber variable in the box (Make sure the selector is dynamic with the variable count in it)
  4. Then increment the values of both SerialNumber and Count by 1 so that the value will be written in the next line and the serial number is 0002.

Hope these steps are clear, please let me know if you have any queries