Importing Records to a Subform
The following section describes the steps for importing Records to a Subform. This can be used if you have multiple Records related to the Subform already available on a spreadsheet outside ActivityInfo and you don't want to manually add these Records.
The supported spreadsheet formats on ActivityInfo are:
- Open office
- Libre office
Make sure to include the Headers and the Key(s) to the Parent Form when you prepare your data for import!
Please note that you need to ensure there are no duplicate Records for fields that have been defined as Keys while preparing the data in the spreadsheet.
When you import data that match Keys of Records that have already been added to the Subform, then the Records with the matching Keys will be updated. This means that you can easily update multiple Records by importing the updated data and using the Key fields that correspond to these Records.
If you use Serial Numbers instead of Key fields or no Key fields at all in your Subform, then you cannot update multiple Records using the importer.
The Serial Number is a field assigned to a Record automatically, so you can choose to ignore it during the import.
How to Import Records to a Subform
Records are imported per Subform. So first you need to design a Form with a Subform on ActivityInfo or navigate to the Subform you are invited to add Records to.
- On the spreadsheet where your Records appear make sure you include all the relevant fields as they appear on the ActivityInfo Subform.
- Each of the Required fields in your ActivityInfo Subform must have a corresponding column in your spreadsheet. If you don't have such fields in your spreadsheet, you need to create them.
- For Single Selection fields make sure you add the answers in the exact same way as they appear in the Subform in ActivityInfo.
- For Multiple Selection fields, add the available answers for each Record in one cell, divided by commas.
- For Date fields use the international format "YYYY-MM-DD", "YYYY-MM" for Monthly Subforms and "YYYYWX" where X is equal to the number of the Week for a Weekly Subform to prevent a wrong format conversion.
- You need to link the Records of the Subform to the Record of the Parent Form to which they are added. For this reason, you need to add a column in the spreadsheet that includes the Key of the Parent Form. By doing that you define for which Parent Record you are adding Records. If there is more than one Key in the Parent Form you need to add as many columns as the Keys. If the parent Form uses a Serial Number, this is the Key of the Form.
- If instead of a Key field(s) you are using a Serial Number, note that the Serial Number is a field assigned to a Record automatically by the system, so you can choose to ignore it during the import.
The Key can be the Serial Number of the Parent Record to which you are adding Records or another field that has been assigned this value by the person who designed the Form.
- Navigate to the Table View page of your Subform.
- Click on the "Import" button.
- You will be redirected to the Record Import page.
- Select all the Records you want to import from the spreadsheet including the column headers.
- Copy (CTRL+C or Command+C) the Records and the column headers.
- Paste (CTRL+V or Command+V) the Records and the column headers on the Record Import page.
- Click on the "Continue" button.
- Required fields must have a corresponding column header in your table. Otherwise a message will appear prompting you to add these fields.
- In the following import table some of your column headers will have been matched to the ActivityInfo column headers. These will be highlighted in green.
- Take a look at the matched column headers and make sure they have been matched correctly to the ActivityInfo fields.
- If a column has not been matched correctly, click on the header of a column to view the possible field matches and select the correct match, if needed from the 'Column Matching' side panel.
- You can choose to ignore a Column by selecting the "Ignore this column" option.
- Once you have matched all the columns, click on the "Continue" button.
- In case of invalid Records you will be notified by the system. If you continue importing, these rows will be ignored and not imported. You can click on "Download"invalid records as CSV" to fix the Records and retry to import them.
- In the next step, you can review the Records to import. If you used the same answer for a Key field of the Subform then you will update an existing Record instead of adding a new one. If you used new answers in the Key field, then a new Record will be added.
- A progress bar will show the progress of the importing process.
Do not close the window while the importing process is ongoing.
- Once the process is completed, you can view the imported and updated Records.
A message at the bottom-left corner of the table will inform you on how many Records were imported to the Subform.