Arrange your list in ascending/descending order in kodular without extension

Hello friend, today I am going to share a method with you so that you can arrange the list in ascending or descending order without any extension in kodular or any app inventor.


Arrange your list in ascending/descending order in kodular without extension

Read the full guide to understand what happened


If you want to download Screen. Click the button below.



Creating Variable


Before that, we have to create some variables-


  1. Main List- The value will be stored in the list after ascending and descending order.

  2. Temp List - In this, we will store the value temporarily.

  3. Temp List2- In this, we will store the value temporarily.

  4. Leaderboard Name- Name of players

  5. Leaderboard Points- Score of players

  6. Temp Name- Name of players again

  7. Temp Points- Score of players again


Variables to sort List(app inventor, kodular)

Storing values to list.


Right now I am storing the data in firebase. And calling it again from firebase. This helps you to know about storing data and receiving data from firebase.


Calling data from Firebase(app inventor, kodular)


After that, we will store the data in the list. Store the data you want in separate lists.

  1. Leaderboard Name- Name of players

  2. Leaderboard Points- Score of players

  3. Temp Name- Name of players again

  4. Temp Points- Score of players again

This is what I stored.

Storing the data in separate lists (app inventor, kodular)


Storing the data in separate lists (app inventor, kodular)(app inventor, kodular)

Storing data takes time and without delay, it causes errors. So, I am using a clock component for causing a 20-millisecond delay.

Clock for delay (app inventor, kodular)

This will make sure that if all the values ​​are stored properly then the next function will happen.


From the following block, I wanted to check whether the list call has happened or not. Everything, I wanted is in place or not.

Checking whether the list call has happened (app inventor, kodular)

Sorting starts here


Now from here, we will start sorting the list. If you want to sort any list, put numbers in Temporary List 2. 

sorting the list (app inventor, kodular)

The block is given above. First of all, we have created a temporary list as an empty list. After this, we connected two different for-each-number components to the same list. In which we remove the value by using the if-then component if both have the same value.


Then we use the if-then component to add the higher value to the temporary list which

we had made an empty list earlier. 

adding the higher value to the temporary list (app inventor, kodular)

The value which is in the Temporary List 2 [not in the Temporary List]. That is the smallest value. So we will store it in the main list

storing smallest value in the main list (app inventor, kodular)

But before that, I stored the value in a text. And then run a timer (with the help of Clock Component)of 10 milliseconds. This gives sufficient time for storing the values in the list.


When we will store that value in the main list with the help of text. Then we remove it from Temporary List 2.


Now we will convert this whole process into a loop using the if-then component. This loop will continue until the length of the main list is get equal to the length of the list containing the leaderboard points.

converting process into a loop (app inventor, kodular)

And then we will display the value of the main list with the help of the listview component which we stored and sorted into ascending order.

Dynamic Listview (app inventor, kodular)

If you need this list in descending order, just reverse it by using the reverse list component.


Descending order list (app inventor, kodular)



Download AIA

Post a Comment

3 Comments

  1. Hey anyone have question; Ask here.

    ReplyDelete
  2. Replies
    1. https://drive.google.com/u/0/uc?id=1gB2_F8z1G8MMOLQ5KHrO7hJGEIGCwt5R&export=download

      Delete