How do you export forms

How do you export app forms from the cht

For doing basic exports of CHT data, you can use the “Import & Export data” tab in the App Management interface. When you say “app forms”, I am not sure if you mean the reports that have been created by users submitting forms. If so, you can get a CSV summary of these reports via App Management > Import & export data > Reports. For more complete (and ongoing) access to report data, look into using cht-sync to replicate Couch data into a PostgreSQL database.

However, if by “app forms” you mean the actual form configuration files, there is no way to easily export form configurations from a CHT instance. The typical practice for managing CHT configuration (such as forms) is to store the configuration files in some sort of source control management system (e.g. git/GitHub) so they can be easily accessed by developers with proper version control to track changes. Then, changes to these configuration files are uploaded to a CHT instance via the cht-conf tool.

That being said, if you need to audit or recover form configuration from a CHT instance, it is possible to access the configuration data from Couch. First, use the App Management interface to find the Id’s of your forms. In the “App forms” tab, you can see a list of the “Installed app forms” that each have a Unique ID value. These are actually the id keys used to store the form data in the medic database in Couch. So, once you have the ids of the forms you want to look up, you can use Fauxton to find these records in Couch:

  • Open the medic database in Fauxton (/_utils/#/database/medic/_all_docs)
  • Enter your form Id in the “Document ID” search box
  • Click into the matching document

Once you have the form record open in Fauxton, you can see some of the information configured for that form (e.g. the data from the form properties.json file). The actual form configuration is located in the xml attachment (view it by selecting “View Attachments” and picking the xml entry). This is the form xml document that is generated from the form xlsx file when using cht-conf to run cht convert-app/contact-forms. Unfortunately, the xlsx file is not uploaded to the CHT and so there is no way to recover the actual spreadsheet, just the xml.

1 Like