User updating tables

I am trying to make an app that allows students to enter in data on the plants that they are growing.

There are 10 different plants growing in the garden.
20 students will be accessing the app to record data. Ph levels, temperature etc. After a month of observations and logging data we want to export the data as a growth chart.

Is an editable table the best way to do this?

Kind regards,

I would do it like this:

  • Users table: RowID, User email, name, image
  • Plants table: RowID, Plant name, description, image
  • Plants x Users table: RowID, Plant ID, User ID, Added at timestamp
  • Growth table: Plants x Users ID, Added at timestamp, Ph levels, temperature

After a month, you can export data from the Growth table.

1 Like

Thank you ThinhDinh. I will give it a go. Just checking that when you say ‘x’ you mean a link them together make a ‘relation’, is that correct?
Ta

It’s just a table name, I mean it’s a table where you store a combination of one plant and one user on each row.

Ok I have given it a try. 4 tables linked by ID

Thank you

1 Like

Hi there ThinhDinh

I am actually thinking I am over complicating things. I might just need a form for each plant and the students update the forms. Would this work?

ta

That sounds like a lot of work.

Wouldn’t you be better with a single form where the Students select the Plant from a list?

Yes, selecting the plant from a list would be perfect, I am just having trouble with the new height data etc pushing into the row in the existing ‘plant’ form.

I have been trying to make the column ‘Height’ in ‘Plant’ table relational so that when submission happens a new row is made. However data keeps being propagated in new columns not under row that belongs to that plant.

Humm

Are you able to share a couple of screen shots?

That will make it easier to visualise and perhaps provide some guidance.

Yep on it now.
Thank you so much

I think you need a separate table to record your growth logs.

This table should have the following:

  • PlantID
  • Date/time
  • Height
  • Soil Moisture
  • PH

Then instead of adding rows to your Plants table, the form should add rows to your Logs table.

Once you have it setup that way, you can create a multiple relation column in your Plants table that matches the PlantID in your Logs table, then use that relation as the source of a collection on you Plant details screen. This will give you a log for each plant. You could also quite easily create that line chart in Glide.

2 Likes

Ok this is great. I will give it a go now.

Talk soon,
Thanks again

Should I be using Form Elements to allow users to update logs table?

Thinking ‘submission’ might be the way to go as new data when entered into Logs over writes old data. Now trying to set up the relations.

Rather than adding input components directly to the details screen, you should add a Button, and set the action on the Button to “Show Form Screen”. Then set the Logs table as the target of the Form screen. This will have the effect of adding new rows to your logs table, which is what you need.

2 Likes

Ok great, thank you so much for this idea. I am getting there. The button is working, action is creating new rows and data is arriving into the Log table, however the log table is capturing new data for all the plants, not individual plants.

In your Data Logs table, you need a column for PlantID. This column should be populated when the form is submitted. The way to do this is by using a Column Value.

Once you have that, you can modify that relation column so that it matches the PlantID with the RowID in your Plants table. Make sure it is a single relation. Then you can fetch the Plant name for each row by adding a Lookup column that targets the relation column.

1 Like

Ah, so close. Thank you so much Darren. I am so so close. It keeps adding an extra row so that the new entries are not lining up. There is a gap between each of them, I think it might be that one of the relations is ‘match many’, thoughts?

Don’t use the forms On Submit action to add a row. The form already adds a row. Adding a secondary Add Row action On Submit is redundant. You should be able to add the appropriate components to pass values through the form. You do not need to use On Submit.

4 Likes