Listpicker data in alphabetical order

No, I took them from a list and copied them, but as you may have guessed they weren't in alphabetical order.
So if it happens to me again that I enter the names or something else, believing they are in order, I would like the user himself, seeing the error, to be able to solve the problem:

I also have to foresee my programming errors and have them resolved where possible by the user and this is one of the errors that could happen.

Reprogramming the App and redistributing it, I do not think it is professional, because in any case the user will have noticed that I have been inattentive, losing my personal image and seriousness. Plus by not providing him with a button to do it himself.

But of course it is foreseeable that slowly as I go on in the construction of the app I will come to insert new elements, to eliminate them and more.

I have a small program here that can take a simple list and turn it into an App Inventor Blocks List. Worth a try. Can you upload your list as a text file here? I will process it for you (if such a large list will work).

One thing to consider I think - the User will be selecting from the List? If so, I would split it up into several lists so that the List on Screen is relatively short.

Heck, that would be a fantastic help. Thanks.

A completely personal comment of which I apologize to the authors of appinventor, who surely if they did not intend to include these properties they will have had their reasons) But,
I don't understand, why, who created the listpicker component, and listview, did not insert plausible properties in a list component.

He should have imagined having to insert a property with a flag that ordered the lists in various ways.

We are asked (I mean people like me, Lamer) to study to do things optimally and properties so important that would save time and errors, have they left to personal inventiveness? BO!

Talking to myself :grin: Angelo I think you need a way to present the User with a shorter list. Perhaps alphabetical lists? A list of names starting with A, another for B etc.

Maybe you are right, indeed you are certainly right.
Anyway the system you listed above is not bad, try to send me the .aia file if you can and I'll see if it solves my problem.

Upload your list, let's see what we can do. Since list editing (not just sorting) is required, the initial data should be stored as a CSV file/files (or text file) and loaded on demand by the App.

Here is a sample doc and app that shows how to help the user navigate a very large sorted list using a Divide and Conquer approach.

Considering the idea of adding dynamic sort capabilities to the List Picker and List Views, remember that the aim of MIT AI2 is to provide simple tools that can be combined to make more complex tools. The alternative is:


Sorry but I've been busy, thanks again to you and everyone for the tmepop you dedicate to me
I think I understand that you recommend entering the names, in multiple .csv files, therefore already in alphabetical order, and then loading them in that order.
Yes, the solution seems optimal and I thank you.
But are you also telling me, that it will be impossible for a user, via a button, to put in alphabetical order in the listpicker, a possible list that is not?
Of course with your system, I solve the problem, but I would have to prepare dozens of lists, so that the system you suggested is fluid and does not make it wait too long for the .csv file to load
I was thinking of something much more practical and functional as I wrote to you, but if there are no other solutions, you have to be satisfied. Thanks.

Il file che hai allegato contiene troppe virgolette e tabulazioni inutili, non credo che sia l'originale.
Non puoi ordinare direttamente una listpicker, devi:

  1. leggere il file di testo con i dati separati da virgole senza "
  2. popolare una lista utilizzando List From Csv Row Text
  3. ordinare la lista come ti hanno già mostrato
  4. popolare la listpicker con Set listpicker element to (la tua lista già ordinata)

You could do something like this:

You will have to manage the selection returns accordingly.

I used @Faraz_Firoz 's Lists extension

Hi Angelo

  1. Speed - your App can load a CSV in nanoseconds.

  2. Alphabetical Order - the CSV files do not need to be pre-sorted, the App can sort them when the User loads them (on demand).

  3. It is possible to give the User Simple tools to edit a list - add/delete/modify existing name/Sort/Save.

One thing of interest Angelo - how is your App going to work with multiple names that are identical? In the UK for example, practically every other street has a John Smith. Or is your list not a list of people but a list of first names to help people choose a name for their new born - something like that?

Find attached aia with your text file in correct csv format and 2 sort ways.
ListSort_1.aia (79.6 KB)

Guys I really thank everyone, you are making me excited for your help, I do not know how to thank you, I offer you a virtual coffee and if you are going to travel to Italy, inform me and I will offer it in person. I will try your solutions and I will be able to tell you.

It doesn't work in either.
In the list views even if I delete the .txt file. from the root directory path, they keep displaying the names, and I can't figure out where it loads them from.
Therefore the .txt file is useless.
Unless this extension is good for "other uses", because it is absolutely unusable.

Thanks anyway you were very kind to dedicate your time to me. I'll settle for making the alphabetical list manually from Excel.

In the listpiscker, nothing happens, the list remains in the original template without changing and alphabetizing the names.
Reverse doesn't work either.

Hi Andrea, where did you get the list from? It's Family names only, 14480 of them?

Not sure what you are doing, but applying the text file to my blocks and using the extension works as expected....

sortForlistpicker.aia (65.6 KB)


In this example I see that the sorting speed of the "Lists" extension is a bit faster than JavaScript, on my device the JS code takes 29s and the extension code takes 22s.

Order_List.aia (230.6 KB)