Import & Export of multiple Forms 2.0 from Implementer Interface

Currently, Implementer Interface for Forms 2.0 allows the user to export the form one by one. Also, import of form is allowed only one at a time. This is not optimal, especially if the user is working with 10-20 forms and multiple versions and needs to manually click on the export for each. This issue was discussed in PAT Call on 12th June (PAT Call 12 June 2019 - Google Docs).

For this, we propose an import & export action for multiple forms at a time:

  1. A user can choose which forms to export through the checkboxes next to form names
  2. The forms will be downloaded/exported as a zip
  3. A user can import multiple forms at a time through a zip file
  4. A user can import a single or multiple forms as json file from the window picker. The latter will be developed based on technical complexity
  5. Forms should be imported in draft version, and will be manually saved and published by the IE

image

Please share if this flow works for your use cases

@angshuonline @mohitd @sudhamsh

CC: @snehabagri @vmalini @bhiravabhatla @binduak

After discussion with the product team, we decided upon the below idea for import/export multiple 2.0 forms in the form builder

  • Export
  1. A new API, that will take multiple forms UUIDs list and the response will be a zip file with the list of form.json files ( form resource and translation)
  2. On UI restricting the user to select only ā€˜nā€™ no of forms, in order to reduce the load on the server.
  3. For all the errors for the forms on the server side, all are written to one error file and added to the response object
  • Import
  1. Currently, for a single form, we are uploading the JSON of the form to be imported. Now for multiple forms, we will upload a zip file that contains all the form JSONs to be imported
  2. Unzip and perform all existing UI validations for each form and make separate existing API call for each form to save form resource and translations
  3. Just like in export, restrict the user to import only ā€˜nā€™ no of forms in a zip file
  4. As API change is not there, so error handling will be the same as in the single form import

Please let us know if you have any suggestions/concerns. Thanks! @angshuonline @mksd @mksrom @rajashri @swetha184 @jinal @snehabagri @vmalini @shivarachakonda @sowmika @binduak

1 Like

The API we are going to use for exporting multiple forms in form builder is below :

API: /openmrs/ws/rest/v1/bahmniie/form/export

Method type: Get

Request & Response for the above API looks like below:

Request:

{ formUuids: [ "1234", "5678"] }

Response:

Returns with .zip file

Please let us know if you have any suggestions/concerns. Thanks! @angshuonline @mksd @mksrom @rajashri @swetha184 @jinal @snehabagri @vmalini @shivarachakonda @sowmika @binduak