Creating Profile to store other reading

if some ones need to create multiple users profile to store there blood glucose when they measure, how could it possible?
let us... when the users use this application
first the users by them salve create there own profile and store there multiple reading every day,....how could it be possible using Tiny DB ?

You can use FirebaseDB component

1 Like

Why ? OP wants to use tinydb....

@sol_roll show (relevant blocks / screenshots etc.) how you are creating a single profile for your user, then we can probably help you to create multiple profiles for a single user, using tinydb.

2 Likes

TinyDB has a NameSpace feature that lets you keep separate instances of TinyDB for different purposes, like user profiles.

Switch your TinyDB NameSpace as you switch your user profile, so each NameSpace can have readings for one person.

I like the Clock1.SystemTime milliseconds value for a TinyDB tag for this, because it matches chronological order with tag list sorting order, and can be reformatted to your taste for display purposes using Clock blocks.

2 Likes

ok!... but I need to use tiny DB can you share me simple example for this as ADG says by changing namespace.

This is as simple a functional app for this problem can get.
It needs documentation, but it works.


All blocks:

Exported .aia file:
TinyDB_NameSpace_logger.aia (7.5 KB)

Sample run screen shots, after debugging left some unfortunate profile names on the list that should not happen on a new device:

sample chronological order

sample click on list picker for profile change

Places where I change NameSpace for different profile housekeeping:



initialize global NEWPROFILE to

Places where I record to a user profile:

Remembering the last used profile name as a convenience for the next run of the app:


The From and To Date Pickers are to help filter the ListView:


2 Likes

I love that! ,thank u so much! you teach me a lot of thing about tiny DB I will ask you again if I confused!
finally let me to ask you how could I search for specific parameter in Tiny DB if you are well to answer.

Searching for things in TinyDB is long and tedious, unless you know the exact tag you want, in which case there is no searching needed.

For the long and tedious case, it is best to hide that in procedures.

Here is a sample app that does that in TinyDB:

This would be a good opportunity for you to peek at

  • SQL
  • indexes
  • alternate indexes
1 Like

what about using the local Sqlite database and store your data in tables? Not only you need less blocks you also can filter and search for data easily...

there could be a profile table to store the user data and a blood glucose table to store the multiple readings per user

see my sqlite extension here App Inventor Extensions: SQlite | Pura Vida Apps
there are also other sqlite extensions around...

Taifun

1 Like

I can't understand the use of namespace for Tiny DB block.

the item in a profile erase after a moment why? ... I can't get the reason.

You have to set a NameSpace and use that portion in TinyDB to store elements related to that particular Name-Space, and same process is to be done while retriving them.

2 Likes

thanks it is clear presentation, but one more, can I use different tag name for different profile instead of namespace, what is the main different between tag name and namespace?.... I think tag is the subset for namespace.

You can think of tags as different database tables in same db, lets say, MySQL and name spaces are like different databases in same DBMS( MySQL).

TinyDB1.Namespace to Fruits, is like USE Command in MySQL.

2 Likes

that's what I want to understand! thanks man!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.