Problem with a list of list in a for each loop

Hi,
I'm a newbie and very happy to find this easy to use android programming tool. First app works fine but now I like more functionality.
I have some IoT pieces and want to show the status after screen initialisation. My idea is a list of a list with the component (to show the status) and the corresponding url.


But I found no way to use this data in a loop to initialize. Does anyone know which block I have to use at the missing positions or is my way completely wrong?

What are those 3 green components?

Select list item component
                 1

Select list item component
                 2

Taifun

@ABG This are the names of the buttons

@Taifun THX. I have tried this, but it works only for the last button. Perhaps the loop is to fast and the response of the first 2 things is overwritten by the last (gali).
Here is the complete sheme (one button as example)


A click on the buttons works fine.
The initialisation of one button without loop works also but not for a series of buttons. In this case only the first will be initialized.
Is there any way to add the response inside the loop? I found no other way for the "web1.GotText" than this when block.

You probably need something like this:

iterate over your buttonInit list, fetching the data for each device back one at a time.

The procedure should be reusable for later on in your app.

Hi TIMAI2, thanks, looks interesting, I will try it.
I found my problem, it is the variable button. It is overwritten before the web.get is finished, so only the last button will be set. I'm not sure if this problem is solved with your solution.
If I add for every button an own web(x).get and button(x) variable it runs. It's not so nice like a loop but works.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.