Importing related objects
Importing from a spreadsheet limits you to importing one type of object at a time. It is often useful to be able to set up relationships between imported objects. For example, you might have a database table of Vendors with a primary key and a database table of Products with a foreign key pointing to the primary key of Vendors. To import this data structure and preserve those relationships, follow these general steps:
- Create a Vendor object definition.
- Create a text field to hold the Vendor's primary key. Make sure to check the attribute Do not allow duplicate values in this field.
- Import Vendor data from a spreadsheet or CSV file and populate the fields, including values for each primary key.
- Create a Product object definition with a text field to hold the foreign key.
- Create a many-to-one relationship between Products and a Vendor.
- Import Products from a spreadsheet or CSV file. When importing, map the foreign key field to the unique primary key field in the Vendor object.
If you no longer need the foreign and primary key fields, you can
delete them. When you created the relationship between the two objects, Platform
automatically created fields to manage the relationship.