How do you create an ordered list from checkbox entries?

Greetings,

I have reviewed many documents and posts "but I still haven't found what I'm looking for . . ." Worse, I am pretty certain that someone has addressed this (multiple times) and I just can't find that information. If this is so and someone would direct me to the data, I would be most grateful.

What I am trying to achieve is for the user to select from a quantity of checkboxes on a page (1 through all) and for that checkbox's associated text label to populate a list [in the order that it was selected] on another page. There must be a shopping app out there which offers a generic list of items from which I prioritize my own list, in the order of selection but I cannot find such an app example. Thank you for any nudges or pointers.

Something like this:

1 Like

Two samples:

Hi

Thanks for the references. I have come acress both of these and I am keeping Multi Check in the back of my mind in case the direction I am heading is a dead end. It just seems so very different from what I am trying to achieve.

Hi,

Thank you for the example. I have been working through the day trying to understand and retrofit your work into my project. I am attaching an .ala of a simplified version of what I am seeking to accomplish. It works in the manner I am used to but not in the way I wish.

My hope is to have the data displayed, from top to bottom, in the order in which it was selected. Right now, the display page has a mind of its own and I have no idea why data is returned in this particular order.

If you could show me where I am failing to properly incorporate your work with my existing file, I would really appreciate it. Thank you for your help and interest.
Checklist_Help.aia (48.4 KB)

In your code there are two blocks with the same function ...

One of them is not being sued, so I understand... @Baran_Galocy

@>--->---

Please tell me how I have butchered Multi Check?
[It started out so nice with fruit and ended . . .]

Greetings, Sir (you can tell from the level of respect implied my relative confusion)

So, I took Multi Check and played with it [Please see attached .ala file]. I do not think I left anything off and I discovered the text file used for the check boxes and replaced it with a longer reference list.

My question is "What happens after I check one, or more, lines of conditions? How do I now navigate to the second "page" where the checked lines of text data reside?

I am hoping that, by understanding what is happening here, I will be better equipped to organize my check box selection data in the order selected rather than the (seemingly) random list it now throws at me.

MultiCheck_Play.aia (3.8 KB)

Changed variable global readings_dictionary to variable global Checkbox_List

This then populates the list as expected. If you then want this list as a dictionary, you will need to provide keys and convert.

I may have forgotten to mention that dictionaries store their contents in alphabetic order by key.

Are you using a dictionary?

Looks fine to me.

Oh, you wanted a filter?

Sure.



MultiCheck_Play (1).aia (4.4 KB)

I just responded without seeing your "Polly wanna filter" post. I will play with this for awhile and see if my head remains above the waterline. Thank you.

So tantalizingly close, yet I still cannot take it to the next level I am seeking. My hopes were that, as I checked a variety of items, they would appear in the order selected. I was thinking about entering items in the (shopping) list sequenced on how I shop the aisles. Let's say that I am one totally bottom-retentive individual who always shops from right to left as I enter the store. I could arrange the list in that order for any one particular store but I couldn't customize a similar shopping sequence for Raley's with contents appearing differently than Ralph's (two non-competing, but dissimilar food stores in the SOCA desert).

For my application, no matter how I present the functions available, someone will never want every function - that would be clutter to them - and they might find a particular order of data points more useful than another based on what they require or when they require it. I have no issues with saving this user-defined page with TinyDB, but I am still working on that sequence of order.

Finally . . . a sort of direct question (and thank you for your patience)

If all of my data points were stored in a dictionary (1 = Air pressure, 2 = Dew Point Temperature, etc.) and I called the indices (fancy plural for 9 am;) in a particular order, would the results then display in the order selected or just default to (1, 2, 3, etc.)

Thank you for posting this correction to my code. I will play with it and consider taking it to the dictionary level.

Hi,

I made the changes you suggested but I clearly don't know a dictionary from a list, at least when I see it. Might you look over this .ala at your convenience? I can tell that I am trying to mash-up two concepts and getting nowhere in the process. I think my Generate YAML block should have different variables relative to yours but I am running in a circle of errors (many creatively different from one another) with no off-ramp. Thank you for your help.

Checklist_Help_2.aia (48.4 KB)

A couple of examples:

image

Regarding maintaining list order, here is my To Do list app, which gives complete control over selection and order.

ToDo.aia (7.2 KB)
(editted)

No dictionaries are used, just plain lists.

Gallery link:
https://gallery-appinventor-mit-edu.ezproxy.canberra.edu.au/?galleryid=101e953e-a66f-458e-8fa1-4e4026f01e6c

Dictionaries are good for looking things up, given a keyword, but not for maintaining things in order.

Only lists can do that.

OK, I feel as though I am tediously close to cracking the code, except . . .

I reduced your code to as simple a form as I could make work. I was unable to remove the save ToDo or save Done procedures without crashing the code. I saw the txb.task procedure for "hide keyboard" but I do not see how "show keyboard" is initiated by touching the textbox. I really do not need this function, anyway, as I want to select text labels associated with check boxes.

Am I heading in the right direction with this? I know your code looks like I stripped a Formula race car down to a jalopy but I think It is getting closer to where I want it to be. My hope is that you can give me some suggestions for replacing the textbox keyboard data entry with a checked checkbox and the output with the associated text tag.

I am attaching my original sample help request, which works, but does not return data in the order requested. In fact, it always returns checkboxes 3, 5, 8, 7, 2, 4, 1, 6, in this order and I don't know why. I wish to magically combine this with my stripped-down version of your code which creates data in the order entered but requires keyboard entry. If you have the time and inclination, I would love some hints about incorporating your code into mine, such that the end result is a list that shows in the order it was generated and hangs out in TinyDB. Thank you so much for not "hanging up" on this call.

Checklist_Help.aia (48.4 KB)

ToDo.aia (5.1 KB)


Checklist_Help (1).aia (48.0 KB)

These should do the trick.

It was mostly designating a particular global list to carry the water of remembering the checking history, and updating the name of another global variable to emphasize its responsibility to hold reading values.