Dynamic Lists with Items That Change Over Time

In this case, I have four lists that I get from the web. These lists always contain the same number of items because they are related.

It's worth mentioning that the number of items in the four lists changes periodically. It can be anywhere from 0 to 50 items depending on the number of active users.

I need to create a list without specifying the number of items in the blocks because they are variable.

I could put "Item 1" and "Item 2" in the list, but I would like to avoid that since, as I said, the number of items changes over time.


The logic would be:
If an item or items exist in the list, then I retrieve them in the assigned order and assign them an item number for future actions.

I hope this is clear.


Something like this would be:

For each element that exists, I assign an item number in the order it appears.

Or am I mistaken?

Describe the functional dependency relationships among the 4 lists.

It's impossible to work not knowing what the items mean and how they relate to each other.

*First items: license plates

*Second items: latitude
*Third items: longitudes
*Fourth items: speeds

4 lists in tabular form

Obtaining the first items from each list

Do you need to show a track of previous movements by license plate,
or are you just interested in current speed and location?

For this app, license plate is the key that can be used in 3 dictionaries to look up lat, long, speed.

P.S. You might also need a 4th dictionary, with the timestamp of the last time you heard from that license plate.

Why 4 lists when one list or dictionary will suffice?

It could be, but I'd like to see them moving on a single board like this.

image

not only the current ones, since they change every 5 seconds

PD: También podrías necesitar un cuarto diccionario, con la marca de tiempo de la última vez que tuviste noticias de esa matrícula.

Do you have any examples?

Let's say we have this:

{"ABC":["11","22","33"],"BCD":["HH","KK","UU"],"CDE":["33","44","55"],"FGH":["66","77","88"]}

ABC
BCD
CDE
FGH

These would be the license plates, like a key, as I would represent them in the dictionary.
Any examples?

Remember that there could be more license plates, or there might not be.

You can use 4 parallel ListViews whose Elements are loaded from your 4 original lists.

Put them in a Horizontal Arrangement, side by side.

If the element lists are too long, you can keep the displays in sync by clipping off the same number of items from item 1 of each incoming list.

Work with copies of the original lists, so you don't lose the ability to reload the Elements.

Use the SelectionIndex sfter selecting, if you want to deal with the entire row.

I don't think I explained myself well.

For example, I'd like to use this list ABC, BCD, FGH with (make a list) without having to do this.

I'd like something like this, without needing to add the item blocks while maintaining the order.

Or can I work with this while maintaining the order of the items?

Do you mean the order you input the values, or an alpha-numeric order (ignoring case) ?

So you have this part working, right?

You init the 4 global list variables to empty lists, just to get the names, I hope.

If you just want to show them side by side, use 4 Labels in a Horizontal Arrangement, containg the results of 4 Join With Separator \n against each of the 4 lists.

If you want it refreshed periodically, put a web request in a Clock Timer and have that extract the 4 lists and refresh the Labels.

If you have a json string like that, you can convert it directly to a dictionary:

  • license plates are the keys
  • the content is a list with 3 items: lat,lon,speed

P.S.

Having 4 lists ( which you have to keep “in sync” ) is generally not a good idea, when you add/remove elements, for example

json03.aia (2.8 KB)

1 Like

I think I've solved it.

This was in a previous post where I was doing the vehicle rotation.

Their values ​​were already on the web. I retrieved them and now I have them in lists.

Now I have this problem: I can save and retrieve:
The license plate, the rotation, the vehicle's image name in .png format, and create lists of them.

But what do I do with the markers? I thought about saving them by name like the .png images, but it's not the same.

What do they contain?

I always thought they contained the coordinates.

It's not the same.
How could I get the content of the markers so it can be saved and retrieved, and create a list of them?

So who or what is updating the markers with the coordinates, if the cars are moving?

You said you were getting coordinates off the web.

I remember you had previous threads where you created Markers on a map and updated their locations, right?


Yes, that's correct.
The coordinates are automatically updated every 5 seconds when in use by the timer.

I created 3 markers: one for the mobile user and two more for external users. Now I want to increase the number of users, which is why I need more markers.

Since I already have the coordinates for all of them on the website, I'd like to retrieve them and convert them into a list of markers.

I've seen that you can create a JSON object from a CSV file with just one marker.

That's why I'd like to know how I should approach this for the content and create my list.

Something like this.

You can probably find examples of that in our collection:

No need to reinvent the wheel.

In this same way, can I delete a tag and its items using the dictionary simply by mentioning the tag?

For example, deleting BCD