You can import data from Excel files to load data to your application server entities. This is useful when you are developing and testing your application. This way, you can quickly have your data up and running in the application while developing it.
Validate the Excel file
- Open the Excel file, check that the Excel sheet has the name of the Entity and the column headers have the names of the entity attributes.
- Close the file. The bootstrap cannot read the Excel file if it is open.
If your spreadsheet has blank cells and you're getting import errors, check this Development FAQ on how to proceed.
Bootstrap the data
To bootstrap data from an Excel file to an existing entity:
In the Service Studio, go to the Data tab, right-click on the entity and in the Advanced menu, choose 'Create Action to Bootstrap data from an Excel...'.
Select the Excel file, check the mappings to see if they are correct and click on Proceed.
The Service Studio will automatically create:
- An action with the bootstrap logic named "Bootstrap<entityname>" in the Server Actions folder in the Logic tab
- A structure with the content of the Excel file named "Excel_<filename>" in the Structures folder in the Data tab
- A resource with the Excel file in the Resources folder in the Data tab
- A timer to execute the action at publish time named "Bootstrap<entityname>" in the Timers folder in the Processes tab
Publish to bootstrap the data.
When you publish the module, it executes the action to bootstrap the data. If the entity already has data, the action with the bootstrap logic is not executed.