Sample Data consists of example records from domains related to several industries. Screen Templates use it to create instances of Screens.
Referencing sample data in apps
Sample data is useful when you need to create a prototype, proof of concept, or when you're following a tutorial that requires it. Reference the sample data by including the OutSystemsSampleDataDB module. Here is how you can do it:
Click the manage dependencies icon in the Service Studio toolbar, or press CTRL+Q. Manage Dependencies dialog opens.
Enter OutSystemsSampleDataDB to search the available producer modules. Select OutSystemsSampleDataDB in the results, and in the right pane select all Entities of the module.
Click Apply to confirm and close. The Entities are now available in the Data tab of Service Studio.
If there are no results when you search for OutSystemsSampleDataDB, that could mean that the OutSystems Sample Data component, usually installed with Platform Server, isn't present in the environment. Try installing the component manually.
Managing OutSystems Sample Data
The OutSystemsSampleDataDB module, that comes with the OutSystems UI component, provides a collection of public APIs that lets you:
- Export original data and Import your sample data
- Reset the sample data
View the Sample Data
Sample Data entities are public, so you can create a custom back-office.
Import your Sample Data
Follow these steps to import your own data for use in Screen Templates.
Use the DownloadOriginalData Server Action from Logic > Server Actions > OutSystemsSampleDataDB > Export to save the original source files in a zip archive. You need to create a logic to download a file, by adding a Download element at the end of the flow.
Edit the source files in the zip archive with your own data.
Use the Import Server Action from Logic > Server Actions > OutSystemsSampleDataDB > Import to upload the updated file and replace the current data. You need to create logic for the import, similar to the one you created for export.
Reset the Sample Data
To reset the sample data:
- Go to the Factory > Modules tab.
- Search for OutSystemsSampleDataDB.
- Go to the Timers tab in the module details.
- Select the Reset_SampleData timer and click Run Now.
If any app extends the provided entities, the Foreign Key constraint won't let the timer run successfully. To overcome this, delete such references (records) first.
Custom data model and records
You can create your own Entities as the source of data in your Screen Templates. This can be more suitable for your business requirements.