iSchool Moodle Training

Tuesday, November 05, 2024   

Uploading data to a database

Sometimes you may want to provide a complete database as a reference tool for students, or you may want to simply enter some basic content into a database that can later be edited or added to by you or students. Choosing to “upload entries from a file” requires a little work ahead of time to ensure the content will be read and placed properly in the file.

  • Prepare the upload file:
    1. Setup and note the exact names you set for fields in your Moodle database
    2. Use Excel (or other database/spreadsheet program that allows saving as a .CSV file) to prepare your database. (You can also use a text editor and separate fields with commas
    3. In the first row of your file, the field names should be typed exactly as they were entered in your Moodle database setup. For example: “state, capital, state_flower, state_bird, population,” etc.
    4. Save the file as a comma separated variable file (.csv)
  • To upload your prepared file:
    1. Click on your database link in your Moodle course.
    2. Click on the “Add entry” tab.
    3. Click on the “Upload entries from a file” link.
    4. Click on the [Browse] button to find your file.
    5. Click the [Upload file] button to add the file entries to your database.
    6. If successful, it will import the entries then report how many were added. To view them, click on the “View list” tab.

You can upload information this way for just a few fields for database entries and then go back to add other content. This is a particularly important note for databases where you have set up a file field or picture field. These field entries must be added individually. For example, you may want to set up a database for information about the states and start with just a list of state names. Students would then need to go to each state listed and edit the entry to add pictures of the state bird, or to add a report file they created that explains other information about that state.


Search