Importing & Exporting
Transcript Summary
Introduction
What's up, Databasers? Sam here. Today, I'm going to teach you all about importing and exporting. So, let's hop right into it!
Overview
We're going to cover:
- Regular imports
- Template imports
- Field mapping during imports
- Record matching
- Import conditions
- Import rules
- Export templates
- Importing and exporting from the live app like a user would
Additionally, I'll explain non-importable fields that can't be imported into your app from a spreadsheet.
Regular Import Process
Let's say you have an expense spreadsheet that you want to import into your database table regularly. Here’s how to do a regular import:
- Select Import: Click the "Import" button at the top and browse for your CSV file.
- Field Mapping: The system will prompt you to map fields from your CSV to your table fields. The platform has a smart system that matches fields based on the names in your CSV and your table.
- Headers: Indicate whether your CSV has headers, and the system will handle the rest.
- Delimiter: The system recognizes CSV files by default (comma-separated values), but you can specify a different delimiter if needed.
- Record Matching: You can select a field to match existing records. For instance, if you have an expense name or ID, the system will match those records and update the values accordingly.
Once the fields are mapped, you can proceed with the import. After importing, the new data will be reflected in your table.
Field Matching Example
The system matches the fields in your CSV to the fields in your database table. For example:
- CSV field "Expense Name" will map to your database field "Expense Name".
- If a field is unmatched, you'll need to manually select the corresponding database field.
Template Imports
Template imports are ideal for recurring imports where you want to save time by predefining the field mapping.
- Create Import Template: Go to the automation section and create a new template. Choose the data table you want to import into and map the fields.
- Field Mapping: You can either add fields manually or select "Add All Fields" to automatically map everything.
- Import Conditions: You can set conditions to only import records that match certain criteria (e.g., only import records where the expense type is "rent").
- Import Rules: You can apply rules during the import, such as setting the expense status to "Pending" for every record or automatically tagging who imported the record based on the logged-in user.
Importing from the Live App
One of the cool features of this platform is that users can import data directly from the live app. You can create import pages that use templates to allow users to import data into your application.
Record Matching
When importing, the system can match records using a unique identifier, such as an "Expense ID". It’s crucial to use unique fields to avoid updating multiple records with the same name. The system will update the first match it finds based on your criteria.
Show Logs and Cancel Imports
In the automation section, you can view import logs to see if an import was successful or if it failed. You also have the option to cancel an import in progress.
Non-Importable Fields
Certain fields, like "Date Range", are non-importable. If you try to import these fields, they won't appear in the field mapping process. For example, the address field includes several subfields (street, city, state) that need to be mapped separately.
Exporting Data
Exports are much simpler than imports. You can export all records from a table by selecting the "Export" option. The system allows you to:
- Export all records
- Create export templates with specific field mappings
- Export from the live app by enabling an export option in your pages.
Exporting from the Live App
You can allow users to export data directly from the live app. Users can download data as CSV files using predefined export templates.
Conclusion
That's everything about importing and exporting! I hope you found this video useful and learned a lot about how to manage your data. Looking forward to seeing you in the next video!
We'd love to hear your feedback.