Need help - Colin tree list view ( extra button click )

i have 2 elements in list view
and when i press buy button it always takes the index of 2nd element

even when i click buy button of 1st element, it takes to 2nd element buy link

can anybody help me this please

this is my code

this the button click code

this is mysql data base

2 Likes

The problem is in for each number from loop.
As you have set list1 to select list item where list = MySql list and index = number it will select list1 item to last URL.
So use add items to list block to add URL to list1.

Set the index on list to ElementIndex on click

Bro please explain in easy way
I didn’t understood that​:sweat_smile::sweat_smile:

I tried but it didn’t worked
It shows error

You can do it in two methods:
1.Use Colin tree list view element to get subtext of selected element.As each element has different subtext ( URL ) so you can get selected element website URL.

2.A bit complex to understand:sweat_smile:
According to your blocks-
For each number loop will run for length of list and every time it sets list1 to item at that number in list got from response.
And in your case items are two so when loop is about to end the number will be 2 so it will select website URL for second item.
This is why you are getting second item website URL each time.
Solution-
Use add item to list to add selected URL at a particular number.In this way it will add URL of all items and you get that URL after element click.
Sorry I can not show this in the form of blocks because my laptop charger is at repair shop:sob:

1 Like

what changes I should do

After u r laptop charger is repaired please can u show it to us by some block screenshots me and some of my friends are also trying to create a similar concept app

Sure I will do that.
But for now a solution can be setting index to 2 in select list item.
And removing select list item block from for loop and using is before for loop i.e. in
local variable

Note: I (my father) bought a new charger but it not working also.So I think there is problem in laptop.:sob:

hey bro explain it soon it is urgent
please
i want that method

bro waiting for ur solution

since link is 4th coumn
so,
in for loop,
after setting list1 add item to list= list2 ( new list ) and item= select list item list=list1 and index=4

bro can u show blocks

sorry i can not
try it yourself , it is not hard to make this

i am still not getting it

Use list1 in select list item where list = list1 and index=4

i did that also but didn’t get the output

i have given aia file.
please if ur free then help me out

You do not have to set list.
Just do like this:
Add items to list ( list=list2 ) [Item{ select list item ( list= list1)(index=4)}]

These are the blocks…sorry code ( not the real one ):sweat_smile:

Can you send an aia file? I’m going to adjust the order and send it to you again.

1 Like

Here is the AIA file:

1 Like