Importing data exported by Entity Inspector

I would like to use Entity Inspector to export data to JSON and then use these JSON files to import data programmatically.

For example I would export User data manually from the Entity Inspector. The application would check onApplicationStart if there is only the admin user in the User table and import JSON with other users.

Can somebody please share how they do this or if there is another approach to load an empty database with demo data?

You can import the JSON you get from EntityInspector using the io.jmix.core.EntityImportExport.

As an example see the io.jmix.securityui.screen.resourcerole.ResourceRoleModelBrowse screen. It contains the functionality that exports and imports roles.