Abiodun Adebayo

unread,
Apr 17, 2019, 9:46:11 AM4/17/19
to MIT App Inventor Forum
Hi, I have created an app that allows me to fill in data(numerical) into the "Cost of drinks" and "Cost of Food" fields and when the user click "Total" button, 
this sums up the inputs for both "Cost of drinks" and "Cost of food".

What I will like is that everytime I click "SUMMARY" button, the "DRINKS SUMMARY TEXTBOX" should add up all previous inputs and current inputs for "Cost of Drinks" 
and also display the result.
Usingg this example to further illustrate what I want, I enter 1, 2 and 3 as different inputs at different times for "Cost of drinks", when I click the "Summary" button on entry the first input(i.e 1 in this case),  "DRINKS SUMMARY TEXTBOX" displays 1 .

when I click the "Summary" button on entry the of the second input(i.e 2 in this case), "DRINKS SUMMARY TEXTBOX" displays 3 i.e (1 +2 )

when I click the "Summary" button on entry the of the third input(i.e 3 in this case), "DRINKS SUMMARY TEXTBOX" displays 6 i.e (1 +2 +3 )

Screenshot (88).png

Screenshot (87).png




ABG

unread,
Apr 17, 2019, 12:11:08 PM4/17/19
to MIT App Inventor Forum
When Summmary Click:
   set DRINKSSUMTEXTBOX.Text to TinyDB DRINKSSUMDB('Drinks',0)
   if (is a number(Drinkstextbox.Text)) then
       set DRINKSSUMTEXTBOX.Text to  (DRINKSSUMTEXTBOX.Text + Drinkstextbox.Text.Text)
       save DRINKSSUMTEXTBOX.Text to TinyDB DRINKSSUMDB('Drinks' )
   end if


ABG

ABG

unread,
Apr 17, 2019, 12:23:46 PM4/17/19
to MIT App Inventor Forum
A little friendlier version ...

When Summmary Click:
   set DRINKSSUMTEXTBOX.Text to TinyDB DRINKSSUMDB('Drinks',0)
   if (is a number(Drinkstextbox.Text)) then
       set DRINKSSUMTEXTBOX.Text to  (DRINKSSUMTEXTBOX.Text + Drinkstextbox.Text)
       set Drinkstextbox.Text to ''
       save DRINKSSUMTEXTBOX.Text to TinyDB DRINKSSUMDB('Drinks' )
   end if

ABG
Message has been deleted

ABG

unread,
Apr 18, 2019, 11:39:48 AM4/18/19
to MIT App Inventor Forum
Can you post your exported .aia file here?
ABG

Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Abiodun Adebayo

unread,
Apr 23, 2019, 9:23:41 AM4/23/19
to MIT App Inventor Forum
Hi, sorry for the late response
I have been trying to attach the file as requested but it isn't going through on this platform.
Please, can I send it to you via email.

ABG

unread,
Apr 23, 2019, 10:37:42 AM4/23/19
to MIT App Inventor Forum
If you can't attach an .aia file, it may be because of extensions.

If you can, remove the extensions and try to post again.

Otherwise, upload the exported .aia file to Google Drive,
share it, and post the link here.

ABG

Abiodun Adebayo

unread,
Apr 23, 2019, 11:14:58 AM4/23/19
to MIT App Inventor Forum

ABG

unread,
Apr 23, 2019, 1:27:11 PM4/23/19
to MIT App Inventor Forum
I've attached shots of your Designer for your screens.

It's all dithering for nothing,
where what you need is a single screen table of expenses
and sales, along with a table of expense and sales types
to drive selections.

Is this a single person app that can live in one phone,
or is for a business, with multiple people having access to
the app?

You keep track of dates and expense types.
Do you also need to filter the data by anything else,
like by order number or sales person?

Will this app have Internet access?

Do you have a sample spreadsheet set up with data
for this app?

Can you set it up as a shared Google Sheet?

ABG

ScreenDate1_designer.PNG
foodSupplies_Designer.PNG
ScreenSuppDate_Designer.PNG
ScreenDate2_Designer.PNG
ScreenDate_Designer.PNG
Screen3_Designer.PNG
Screen2_Designer.PNG
Screen1_Designer.PNG
SUMMARYSCREEN_Designer.PNG
DRINKSSUPPLIES_Designer.PNG
EXPENSES_MENU_SCREEN_Designer.PNG
ScreenSuppDate_blocks.png

ABG

unread,
Apr 23, 2019, 1:29:25 PM4/23/19
to MIT App Inventor Forum
For common reference, this app is up on
at reentry code
HOOK-HOVE-JULY-KNOB

ABG

ABG

unread,
Apr 24, 2019, 11:51:43 AM4/24/19
to MIT App Inventor Forum
Here's a sample spreadsheet at airtable.com with rollups ...

The different tabs are rollups by account and by date.

Using free Yahoo disposable email addresses, you can
create free sample airtable bases like this,
and insert into them from AI2 apps
using the Web component and the airtable API.

ABG


Abiodun Adebayo

unread,
Apr 25, 2019, 5:55:11 AM4/25/19
to MIT App Inventor Forum
For now, it is a single person app
The only filtering will be Expenses by date, Supplies by date and Expenses by date
Yes, it will have internet access
Yes, please find attached the spreadsheet for the data.
Please, lets focus on Screen1, Screen SuppDate and ScreenDate as these are the most imprtant for now I will just apply the same code block design that you recommend.
Thanks. 
RETAIL APP EXCEL.xlsx

ABG

unread,
Apr 25, 2019, 2:43:51 PM4/25/19
to MIT App Inventor Forum
I suggest studying how to use Google Sheets with AI2 at
and basing your sheet design on this form of your data

Note the two sheets, one with detail rows
to be entered one at a time with a Google Form,
and a second sheet of permitted Category/SubCategory pairs
that you can expand as need be without having to change your app.

The Google Sheets API Query Language lets you summarize
and group, as explained further down in the first link.

This is the most flexible way to store your data, short of
using MySQL.

ABG

Abiodun Adebayo

unread,
Apr 26, 2019, 11:37:28 AM4/26/19
to MIT App Inventor Forum
Hi, thanks
From what I studied, I may need a google form for to allow the end user to be able to input values as these excel sheet you shared with me will not allow the user 
input values.
Then how can I get the total for each category, please help with this.

ABG

unread,
Apr 30, 2019, 12:49:17 PM4/30/19
to MIT App Inventor Forum
I have added automatic total columns to 
summary and reference sheets Categories and Dates
in the shared spreadsheet at

The daily and category totals are updated by Google Sheets automatically as each detail row is added.

However, if you want totals by both date and category, you would
need to switch to a SQL based approach like MySql or
the soon to die Fusion Tables, and use their GROUP BY Sum facilities.

ABG


Reply all
Reply to author
Forward
0 new messages