Error from Companion: The variable is not bound in the current context

2,867 views
Skip to first unread message

Tona

unread,
Jan 9, 2017, 11:58:14 AM1/9/17
to MIT App Inventor Forum
I'm receiving the error " Error from Companion: The variable $accountList is not bound in the current context"

I'm trying to populate a list view with user input from another screen. I've attached a screenshot.


Auto Generated Inline Image 1
Message has been deleted

Taifun

unread,
Jan 9, 2017, 12:44:08 PM1/9/17
to MIT App Inventor Forum
does this happen after using Do it in the for each item in list block?
try to use Do it in the initialize local block instead...

btw. the item can't be a list in this case, can it? so IMHO it does not make sense to select the first and second item?

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

Tona

unread,
Jan 9, 2017, 12:54:24 PM1/9/17
to MIT App Inventor Forum
I've used do it in the initialize block. I was debugging the app, because it's not working so I went from initialize all the way down. The item you are referring to is the iteration of the database key. I'll show you the save portion. The item is not a list, but the unique key tag. So the key tag 1, should pull up Account #1 with index 1 being, the account name, and index 2 being the balance. When I run the app, I'm getting the error "The operation select list item cannot accept the arguments [1] [1]"


Auto Generated Inline Image 1

Taifun

unread,
Jan 9, 2017, 2:21:33 PM1/9/17
to MIT App Inventor Forum
When I run the app, I'm getting the error "The operation select list item cannot accept the arguments [1] [1]"
yes, because as already said, item is not a list...
you will have to get the value of tag = item first from TinyDB using the TinyDB.GetValue block



now you can select the first item from the list listAccountNameBalance to get the account name and the second item to get the balance

Taifun
                       
Reply all
Reply to author
Forward
0 new messages