Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Entry form for creating records in related table

Featured Replies

I'm working on a database for veterinary exams. During an exam, a set of measurements on an animal can be taken but not all possible measurements are recorded during each exam. Therefore, my current design has a parent table called 'Exams' and a child called 'Measurements' and they are related through the primary key of the 'Exams' table so that each measurement that is taken is recorded as a new record in the 'Measurements' table (with a label, e.g. 'right leg length', and a value, e.g. '50.5cm'). See attached screenshot of relationship graph.

During the actual exam, data are recorded on a paper form (please see attached photo for example of form). To streamline the data entry process, I would like to recreate this form in digital format within an 'Exams' layout, where all the possible measurements are shown within the digital form (just like the paper form) but where only the measurements that are filled in have a record created for them in the 'Measurements' table. This is where I'm a bit stuck, I'm not sure how to go about this as using a normal portal to the measurements table will not allow me to recreate the form with the same design as the paper form. 

I've got a few ideas as to how to make this work, but they all seem a bit clunky and was hoping someone here had a better suggestion as to how to go about this? I think the easiest would be to create fields within the 'Exams' table for each possible measurement and removed the 'Measurements' table all together, but that will result in having a lot of empty fields and will make reporting more difficult (correct?), and there are a couple other procedures/table (e.g. 'Necropsy') where measurements are taken as well so I'd like to have a single table with all measurements in a single location. I could also create a helper table where the measurements are entered, and then a script creates the necessary records in the actual 'Measurements' table, but this seems it could be highly prone to error/problems and would result in duplicated data.

Please let me know if any clarification is necessary. Any help is much appreciated! Thanks.

Screen Shot 2018-12-24 at 9.03.07 AM.png

IMG_9241.HEIC

  • Author

Thanks Comment! This is a very nice solution. It doesn't allow me to quite reconstruct the data entry form in the same layout as the paper form, but I think I should be able to get this to work. Appreciate the help!

52 minutes ago, Eli Walker said:

It doesn't allow me to quite reconstruct the data entry form in the same layout as the paper form,

You should be able to get very close (or at least as close as can be practical for an on-screen form). Keep in mind that you can split the questions into multiple portals (with each portal starting at a different row), then position and format each portal individually.

  • Author

Okay great, that’s what I was thinking so glad I’m on the right track. To create the portals is it best I create a new occurrence of the child table and relate it and the original on an alternating match key to the parent (to show a different question on the same ‘row’ within the viewable layout)?

Really appreciate the advice! 

1 hour ago, Eli Walker said:

is it best I create a new occurrence of the child table

Oh no, not at all. Just duplicate a portal and set the duplicate's initial row to say 11 (assuming you want the first portal to show 10 rows). Then duplicate it again and set the initial row to 21 - that's how you would create 3 portals,  each showing a group of 10 consecutive rows.

  • Author

I realised that I had misunderstood what you said right as I sent the message.

Great, makes sense for sure. Thanks again!

  • 3 weeks later...
  • Author
On 12/31/2018 at 5:02 PM, comment said:

Oh no, not at all. Just duplicate a portal and set the duplicate's initial row to say 11 (assuming you want the first portal to show 10 rows). Then duplicate it again and set the initial row to 21 - that's how you would create 3 portals,  each showing a group of 10 consecutive rows.

Hi Comment, just another follow up question here. I've implemented the design you said without issue and it works perfectly, thanks so much. How would you suggest setting things up so that you could easily delete a value that was entered? I was just going to put a button on the portal that triggers a script to go and delete that specific answer record, but thought perhaps you'd have a better way of doing this.

Thanks again for the help!

 

If it is important to not have empty records in the values table, then you should attack this on two fronts:

  • In terms of data integrity, you should validate the field as not empty so that the user will be forced to either enter a value or delete the record;
  • In terms of user interface, you can make the user experience smoother by either showing a custom dialog presenting the choices, or just have a script trigger automatically delete the underlying record upon detecting that the field is empty - without requiring any action from the user.
  • Author

Ah, okay. I understand and that was what I was looking for. Thanks! From your first comment are you suggesting that it's not necessarily a problem to have empty records within the value table?

It can be a problem if you're counting the records for some purpose - e.g. how many answers on a quiz. I am also not a fan of redundant records, so I'd rather not create a record unless it has some data. But once it has been created, it's a question of how much effort is it to get rid of it versus what is the harm in keeping it.  I have seen many developers pre-create a full set of records in these situations without giving it a second thought. 

  • Author

Okay, thanks for the insight. Really appreciate your help with all these questions Comment!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.