Can you send aia file?
Your blocks image is unreadable. Right click on the blocks editor, and save blocks as image.
here is a better view of my blocks. Im sure i did it the hardest way possible but like i said im self taught and still dont understand everything. I just dont understand why after i enter infomation such as date, stack yard, and bale count and i press save cloud db does not store the information so i am unable to retrieve it. any help would be greatly appreciated.
From what I can see you are not updating your variables from cloudDB correctly (or your cloudDB from your variables) and therefore you appear to only be working with your global variables in your app....
Your workflow should be something like this:
Set your global variable list to the "value" returned from cloudDB
On update of your global variable
Store the new global variable content to the cloudDB tag
(if necessary) set your global variable to the value returned from cloudDB
In this way you can keep your global variable synchronised with the tag value on cloudDB
Export your .aia file and upload it here.
MGfarm (1).aia (1.6 MB)
I am looking at your app, and I see "Tonopah" and "Spot".
Is that a location (in Nevada?), or something else.
Likewise for Spot.?
Also, you need a tag redesign.
I see multiple keys in your app:
- Farm (Tonopah / Spot ?)
- stack number (is this identifying which stack, or is a count of stacks?)
then I see a possibly dependent value:
- bale_count (tells how many bales were in that stack?)
and a sold/notsold indicator (tells if the entire stack was sold, or just that count of bales from the stack were sold?)
It would be useless to proceed without knowing the shape of your data.
P.S. I made some spot corrections to your blocks, but they would not help unless the tag/value problems were addressed. You are in a multiple simultaneous update situation, so keeping just two possible tags won't work for you.
This is total nonsense for a two tag DB.
The Value If Not There should be an empty list, not a blank. Blanks are not lists.
You have no business updating the ListView Elements here. The new global variable data has not arrived yet. So don't do that.
I include those so they won't go to waste, for educational purposes.
Still need to pin down the data structure.
I can't find previous threads on this app, so I will double check with you on a critical requirement ...
Does this app need to operate in a mixed online/offline environment?
Continuing my analysis of your blocks, I must advise you against some disastrous code, that launched a cascade of inserts that threatened to fill up the MIT default CloudDB server before it overflowed app memory:
These blocks (aside from the logging debug I added at the top)
cause AI2 inserting anew the entire list for a location each time that location's data changes.
It's like an avalanche of inserts.
Another place you do this:
If I were to guess its original purpose, I suppose it might be leftover from an attempt to cache updates while offline, and catch up the updates when back online.
Here's another problem area, involving unnecessary duplication of code.
You have two possible Farm values at present:
(The mysterious Tonopah and Spot names are revealed to be farm names.)
In your blocks, you entirely duplicated global lists, tags, and code for each of the farms.
I saw no actual difference in the data handling requirements from one farm to the other.
This could have been handled by
- using one set of blocks,
- adding a column naming the farm to the list, and
- filtering the displayed list by name of farm.
This a problem, because it does not ties the SOLD indicator to the line item that was sold.
It also breaks the pattern of having a consistent number of columns in the inventory table(s).
More ideas ...
You have a heading alignment problem with your ListViews.
There is a monospace option for Labels and ListViews that can be used (with padding) to line up columns.
Here is a left padding value procedure you can use.
To get a right padding effect, left pad the reverse of your text, then reverse the result.
MGfarm_1.aia (1.6 MB)
Hi sorry tried to reply to you thru my email but that didnt work.
so quick run down about this app.
We are farmers in AZ and this section of the app is an inventory tracker.
we have 2 farms one in tonopah and one at spot rd.
so we have to count the bales in the stack yard each stack is labeled so i want it
to save the date, stack # and bale count, however i want it to save under which farm its located at.
so when viewing it it will show up under tonopah or spot rd depending on the farm.
Then i was trying to get it be able to mark it sold.
I had all this working great when i was using the tiny db but when i found out about cloud db i realized thats exactly what i have been wanting so when ever a foreman, employee, or owner open the app everyone can see the inventory of hay.
omg your are awesome. so i know it all looks super complicated. we are farmers and this is a section of the app for keeping track of our inventory. We ahve two farms tonopah (in arizona) and sport rd (also in az) so thats how i would like the data to be viewed is by farm. then under each farm i am trying to get it to show in a list the date, stack number, and bale count. example
9/25/22 1-A-2 430 bales
10/2/22 2-B-1 560 bales
9/25/22 2-B-3 560 bales
10/30/22 2-A-3 234 bales
then if you click a line a notifier would pop up asking if the stack is sold?
click yes then it would highlight it red (or any color)
if you click no then nothing happens
thank you so much for your help i am going to go thru it all tonight after my kids are asleep so i can concentrate and take in all the help. I have been working on this app for a long time and i think it would really benefit us at the farm its just i have no clue what i am doing. i have asked friends of mine who say they know what they are doing but none of them have come thru helping me. so i thank you so much for your time and advice. I will be updating and changing some blocks tonight and will posted what i have done.
Is it possible for only part of a stack to be sold, like 210 bales out of 430?
Another question regarding inventory management:
If multiple people are updating inventory records, it would be a good idea to record their names with their updates, for accountability.
Who needs hay rustlers?
i didnt think that thru..... yes it is possible for only part of a stack to be sold.
and yes thats a really good idea to add a name to each entry
omg theres so many factors to this. i may be in over my head.
Your biggest factor here is the quality of the app users' Internet connectivity.
Only you can answer that question for us.
Regarding the complexity of online inventory management, there are some YouTube videos that show how to do inventory management on shared Google Sheets. I like Google Sheets as a shared data base because their contents are plainly visible to their owner in a browser.
Coincidentally, the test server ai2-test.appinventor.mit.edu has a Google Sheets component that's fairly simple to use, after some well documented administrative setup work with Google
Alternative ways of getting at your Google Sheets can be found at
if you are worried about that component never getting into production.