Pretty much had it all working the way I wanted, then
BOOM! Somehow my global vars were no longer defined after Spreadsheet1 .Got Column finished. The lblInfo and lblInfo2 labels display correctly the list lstPersonalItems itself and the length of lstPersonalItems, ie,
Well, i think because when you got data from Spreadsheets, The variable lstPersonalItems will be set to the values you’ve got from the database.If you got an empty list from spreadsheet.The variables will be set to empty list.
Also when you set a global/local variable to another value, all old value will be replaced with the new value, so when you set the variable to empty list, all of your data in your variable will be replaced with empty list.
If you want to keep old and new data to together you can make something like this:
1- If you have a list and you will get a new items you want to add in this list make something like : for each item in list values:
add item in list oldValues( your old list ), item = the item variable (for each item in list)
2- if your value a string and you want to add a list :
add item to NewList , item = (your old string)
And then make the step above
Thanks for your reply. I use variables for my column names (and Table names, API Keys, BaseIDs) to prevent spelling errors. I’ve tried it both ways and it makes no difference using vars instead of text blocks. global Status = “Status”.
Thank-you for your reply. The variable lstPersonalItems is set to the Spreadsheet1 .Got Column values. The list has 4 items and IN the Spreadsheet1 Got Column routine, the lstPersonalItems contains 4 list items and can be displayed via the lblInfo and lblInfo2.
After the initPersonal procedure’s .Got Column is finished running, the initTables procedure tries to display the lstPersonalItems and the data is missing.
No. I do not get an empty list. As I’ve explained, the list in the Got Column routine gets the data and displays in the labels in that routine.
AirTables is not the problem, there are no empty rows or cells, the data is there; the last blocks I showed clearly indicates the data is there, the “procedure” labels show the expected Table columns. These blocks work perfectly. The data gets loaded and is displayed by “procedure” after the Spreadsheet1 .Got Column finishes.
The initial blocks I posted do not work. The AirTable table is the same table. After the Got Column finishes, the data disappears.
I do not know what you mean by “get the data before I’ve set it”. The data can be set and retrieved while still in the .Got Column. How do I get it outside the .Got Column?
OK, I’m not even using the if loop at this point, and the problem still exists. Here’s another way to look at this problem. I used a TinyDB to show that the data has been retrieved and can be displayed, unlike the lstPersonalItems.
lblInfo1 displays “16”, which is the number of items in the returned list.
lblInfo2 displays “0”, because the lstPersonalItems has lost its data.
lblInfo3 displays the entire list as it exists in AirTables. The TinyDB doesn’t lose the data.
Turns out, TinyDB does lose the data if I want to access it outside of the .Got Column. I cannot believe this problem exists and nobody else has the problem and nobody has a solution.