List View update

Ho la seguente esigenza
da un elenco di oggetti presente su Google Sheets, tramite ListView seleziono un numero indefinito di oggetti,
dopo aver selezionato l’oggetto, bisogna o rimuoverlo dalla lista, oppure cambiare il tipo di “Colore/Carattere” o, come nell’esempio nel link sotto riportato, lasciare la spunta, senza poterlo riselezionare.
Nel frattempo deve popolare un altro elenco, con gli oggetti precedentemente selezionati.

È possibile fare in modo che, utilizzando la stessa applicazione su più dispositivi, l’elenco venga aggiornato in tempo reale, senza stravolgere l’elenco primario?

Could you help me with some examples?!!

https://x.thunkable.com/copy/a71be67943b02a9fe4e5f540ac63b0a9

2 Likes

See this Error

I cannot check your app because of this error.

1 Like

https://x.thunkable.com/copy/e086a624b32a798a8f771c3393738b79

https://docs.google.com/spreadsheets/d/1AkS6JGmmcPecQclnkKhQpv8QPuAaj5QKyY5E2cf3QDo/edit?usp=sharing

2 Likes

image

Please make your Google sheet shareable. Currently it is private.

1 Like

Done

2 Likes

Try this.

When you click on any item from the upper list it will move to lower list.

1 Like

The solution you have proposed to me is simple and interesting.
I would like to know if the choice can be shared in real time with other users, so that multiple users cannot choose the same “objects”.

3 Likes

Of course you can try. The top list is taken from a Data Source which is shared by every user using the app but the bottom list is an app variable which is created in the phone memory only and not shared with others.

If you want the selected list to be saved then you can create a Local Table or use stored variable so that when you save the list to the table/stored variable it will be local to the phone only and not shared with anyone else.

[Edit]

If you want the selected object by one user not to be again selected by another user then maybe you can add another column in your main list table. This column can be names, for example, selected.

When the user selects an object from the top list you first check if the selected column is true then tell the use this object is already selected,
If the selected column is false then change it to true and add this object to the bottom list.

This is just a suggestion.

2 Likes

Hello!
I did a test project
as you advised me.
But I have a problem
Selecting the Team that I have to create / modify, look for the Team members in google sheet and insert them in the “List_Employee_Select”.
In the text box “Txt_Employee_Serch” I enter the name (by entering the second letter the names appear) ((Works in Live Test, it does not work on the smartphone)), clicking on the name checks if the name has already been entered and opens an alert window that indicates if present in a different Team or if it has already been inserted in the same Team, otherwise it inserts the object in “List_Employee_Select” and updates the google sheet, adding the Team (it does not work if the cell is empty, I have to fill the cell with a “-”, is there any way to make it work even if the cell is empty?).

The problem is that inserting the object in “Txt_Employee_Serch” The “index” takes the first row as a number, how can I get around this problem?

https://x.thunkable.com/copy/f7810c21e1b833d68edaf24afe034dfa

https://docs.google.com/spreadsheets/d/1AkS6JGmmcPecQclnkKhQpv8QPuAaj5QKyY5E2cf3QDo/edit#gid=0

2 Likes

Change the screen block from Opens to Starts and it will work from the phone

image

Is List_Team a list or a text variable?

1 Like

Changing from Opens to Start It works from the phone
why?

List_Team = text variable
ListTeam = List

2 Likes

See this. The one marked with red.

1 Like

my mistake,
I changed the block, it’s probably better that way
to clear the list when the team changes

2 Likes

I modified the “List_Employee_Total” block, to retrieve the “index” row number of the selected object, I used the “Serch_Impegna” function, can you speed it up?

1 Like

I haven’t been following this discussion but the fact that you are using a get value block within a loop is probably going to slow things down a little. You could instead use the list of values block right before the loop to assign all of the values in that column to a list variable. And then just get the list item # app variable Conta inside of the loop.

Edit: Sorry, I didn’t notice the break out of loop block at first. It’s only going to get the value once so never mind!

What about instead of a loop, just using the “find first occurrence of” block in the List drawer? Not sure if that’s much faster but maybe.

3 Likes

Could you give me an example?

2 Likes

This provides the same result but without loop

However, if you want to use a specific letter case (upper or lower) then you have to use a loop.

1 Like

When I insert the name of the object in the text box, I believe it returns the first row (probably because filtering the list the list view returns the value 1 in the index)

1 Like

I made a mistake in the blocks for the get value to return the name while it is already given.

It should be this way

However, this will not work for partial names. It has to have full name (it depends on exact search) otherwise you need to resort to the loop to accomplish partial searches.

Thanks I had already noticed the small inaccuracy,
But when I enter the object name in the text box, I think it always returns the first row (probably because filtering the list the list view returns the value 1 in the index)

which I get by doing the search for the name and giving the variable count the row number

1 Like