Select list item: Attempt to get item number 2 of a list of length 1: ["SHOP1"] Note: You will not see another error reported for 5 seconds

Select list item: Attempt to get item number 2 of a list of length 1: ["SHOP1"]
What should I do?

Where does the error occur?

Breakdown your workflow to stages to find the culprit

You need to teach yourself how to debug your own blocks!

Build a little, test, build a little more, test......

I don't see the point of selecting anything from the listpicker, you do not appear to use the selection?

I see you are using a single Web.GotText event block to capture results from three different web queries, distinguishing among them at arrival time by checking a global variable 'fetch'.

To do this safely, you should set the value of 'fetch' BEFORE issuing the Web Get, and make sure you never have two overlapping web requests of different types.

I usually avoid this problem by pulling different Web components, one per request type, to take advantage of having different GotText events, one per type.


@TIMAI2 No need to select from ListView.
Actually when when I initialize my app
the first I'm seeing List on Listview then I've extention Autocomplitebox when I select from TEXBOX
(NOT from ListView) it has to display seleceted shop values from textbox NOT from listpicker.
but I'm getting this error
Select list item: Attempt to get item number 2 of a list of length 1: ["SHOP1"]

Maybe here is the problem :

Problem Image

That is the only place where I can see you accessing list item at index 2.

This error is caused when you try to access an item from a list which contains insufficient items.

Try using a Do it and then show the output here.

sapremo_1 (4).aia (212.9 KB)

Maybe someone can explain issue and help me, I tried but couldn't find solution yet ;(

It is a bit confusing.

  1. Do as @ABG suggested and set your fetch command first


  1. You are using the same fetch command for two different queries ?




tried still missing ....;(

Try this:

sapremo_1_4_revised.aia (213.3 KB)

I added a clock timer to give the auto_search some time. Seems to need @ 1000ms to prevent the runtime error.

That's cool @TIMAI2 Thank you very much!
is there any way to make it without using Timer. Thanks in advance!

Use the button instead :wink:

1 Like

yes with button it's working but I would like with AutoCompleteBox.AfterSelect ;(
IS there any extention like textbox seach with scroll down list, because I wanted to use AutocompleteBox but as you know there is issue (AutoCompleteBox.AfterSelect)


You might try using a popup menu instead of textbox event listener and auto search, this can offer the selections, but won't autocomplete. Depends on how long your list is going to be....

I cant' use popup menu because
I'll use also for searching, future items name and shop names it'll be too long list . :(((

I can't beleive I googled and couldn't find extention TextBox search with DropDown using app inventor ;(((

Do you need a list of ALL the shops, or just the shops that have orders (in the orders sheet) ?

1 Like

It have to be like a drop down list shops from GSheet

Is that ALL shops, or just shops on the orders sheet ?