Data type structure - feedback

Hi all,

Very new here and looking for some guidance on best practices.


Pet tracking app:

  • User creates multiple animal profiles
  • Each pet profile has different data associated with it ie:
    → Vaccination info, General information, Insurance information, medical information

Where I’m stuck:
On the pet profile page, I am using the tab element to display each category of info.
The first tab, “profile” info pulls in the correct data, that is only associated to the profile, however, I cannot get the rest of the tabs to do the same. Currently pulls all the data in the database.

My question:
Should each info group be its own data source?
If so, would they then have a parental relationship with the pet profile?
Then how do I go about pulling the rest of the data for a specific profile?

Thanks in advance!

Hi there, @nathanmengel7… if I was setting up data types for the app you described, I would likely start with a data type called Pet that includes all of the general information about a pet. Then, I would probably go with separate data types for Vaccination, Insurance, and Medical, and each one of those data types would have a pet field that links to the Pet data type. When a new thing is created in any of those data types, populate the thing’s pet field with the appropriate thing from the Pet data type.

With the structure I described above in place, it would be easy to get a pet’s vaccination, insurance, and medical information by doing a search in those data types for things where the pet field is the appropriate pet.

Hope this helps.


1 Like