When I use [for each item] to extract a value, I don't get the first value right away


I made a block as above.
I want to get [1,1,1].
However, the value comes as [ , 1,1]
How can I get the value [1,1,1] ?

I solved it using a label instead of a variable.
Is it a bug not to use variables?

I hope to let you know if there is a better way.

I believe a storage key has to be a text string. But you are using a list of integers and then setting the key to an item in that list. So you’re trying to get a key that is an integer, not a text string.

You can either change your list to text strings (β€œ1” and β€œ2” and β€œ3”) or you can join the integer values with an empty string (""):

Screen Shot 2020-01-15 at 12.02.58 PM

This method is discussed here.

That doesn’t work
But it was helpful. Thank you.

Well, your keys have to match the keys in the Get call. So make sure you are using text strings for the keys when you save them AND when you get them.

You are not using the asynchronous purple block correctly, which is why errors occur. I recommend that you deal with their work - http://droidscript.ru/main/statyi/thunkablex_base7.php, otherwise you will have problems with purple blocks all the time.

1 Like