I want to remove items one at a time from a list variable (BikeON 0020,BikeON 0019,BikeON 0018) The list variable is retrieved from airtable, the individual item is also from the same table but is also currently the same as the scan value (using airtable as i possibly want to change this in future)
When items are rented out a list is created of every item that was rented with the same contract. When they are returned they are scanned and a list of every associated item is displayed, i wand to remove each item from this list as it is scanned as returned. There are items like helmets that may or may not be rented out with the bikes so need to track each item carefully
You can use the get and remove list block from the List drawer to do this after each scan. You’ll have to find the scanned item (most likely using the find first occurrence of block to get its index number) and then remove it that way.
This seems to be a list in a text format. Use the block make list from text in the Lists drawer to convert it to a list so you can perform the suggestion given by @tatiang
I thought it was something like this but because the blocks mentioned have to be plugged into another block I couldn’t figure how to make them work. I tried the following and it didn’t work, not that i really expected it to… Which block am I missing?
The top set of blocks should return an integer. Assign that to a label (set label's text to) instead of a variable and then let us know what number appears.
The bottom set of blocks should return a list item. Assign that to a label as well and see if it’s what you expect the value to be. Also, ideally, you’d want to remove the item # matching the result of the top set of blocks. So if the top set returns 5, then you would get and remove the 5th item, not necessarily the first item as you have it set to. You can do this manually, putting in the number 5 (or whatever the top blocks return), to test it and then later replace it with a variable.
If you don’t already do this, it’s really important to debug your blocks using labels so that you can see each intermediate step. I find that also helps me piece together (pun intended!) what is happening as I read through my code.