[Solved] In list.....set #....as.... not working?

list_set
Has anyone used this block successfully? I presume it’s the right block to use if I want to replace an item in a list. It’s not working for me. Please help.
Thanks

Hi @Patrick_Elisha - couple of questions here, firstly:

If you’re storing your list in a cloud variable, does it still look like a list when you retrieve it? Are you using any blocks to parse this data?

Hi @Patrick_Elisha, it looks as if you are storing a list of lists? Is that correct?

The variable j needs to be a list if you’re going to assign something to it using an “in list” block. So @domhnallohanlon’s question is key here: what does j look like by itself? Is it a list? Can you view it using a List Viewer?

1 Like


Yes. The task is to replace the sublist item as in pic above.
I have no problem performing other tasks with list but set seems to be an impossibility.
Thank you.

can you try storing them as objects?

How? Can you show me in blocks with reference to my case?
Thank you.

Screen Shot 2020-03-17 at 12.32.23 AM

can you describe a little more about what you are trying to do/

1 Like

If i store as object as shown, how do i get values?
I was trying to replace(update) lat & lon in the sublist.
Thank you.

I’m going to go out on a limb here and say that you can’t use a for loop variable – j – this way. Although j is a list, I don’t think Thunkable can reference it the way you’re trying… by setting an item’s value when the list j is an item of the list subscriptions.

1 Like

I found a way to update sublist iitem:

Thank you.

2 Likes

Nice work!