Dynamic export/import data


I'm currently working on a export and import functionality so we can backup any entity and restore the data of any entity at any point.

The part of dynamically exporting works by using a SQL with a EXEC() functionality and outputting it as a JSON into a structure, joining each result in the list, converting it into binary data and downloading the file.

But I can't seem to find a solution for the import part. Does someone have an idea on how I can import data dynamically? The 3 things I  currently have are; the import files, the bulk insert functionality and the physical table name by looking into the system entity "entity".



Hi Bo,

what format have the import files?

What do you mean by importing dinamically? What's the process of doing it?

Hi José,

The import files are in JSON format.

I have a screen with 2 fields. One with an auto complete which returns the physical table name and a field to select a JSON file which holds the exported data. There is also an import button. Which deletes all the data from the selected entity first and bulk inserts the selected JSON export data into the selected entity.

But how do I get the exported JSON data into the selected entity with a bulk insert? Or if that is not possible, an alternative to inserting the data.

The reason why I want it this way is because the application keeps growing with new entities and I want to avoid to create import and export actions for every entity we currently have.

How many physical tables are available to be selected? If not many I suggest a switch for each possibility.

Upload the JSON and Deserialize the content choosing the data type (List of Entity), the structure must match the JSON. Then you can Insert in the Entity with the JSONDeserialize result using a For Each.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.